Hitachi Vantara Pentaho Community Forums
Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Job Entry plugin.

  1. #1

    Default Job Entry plugin.

    I am trying to create a job entry plugin and it is not working. I can see it show up in the tree, but when i try to drop it onto the the editor, it just wont let me. is there an example of this somewhere?


    I am checking out hte code and it seems that this may not be fully supported, though i might just be confused.

  2. #2
    Join Date
    Nov 1999
    Posts
    9,729

    Default RE: Job Entry plugin.

    Well, a lot of bugs HAVE been fixed with regards to Chef.
    Can you try the latest dev code and see if the bug is still there?

    Thanks a lot,
    Matt

  3. #3
    Join Date
    Sep 2005
    Posts
    1,403

    Default RE: Job Entry plugin.

    I tried this w/ the latest source, but have the same problem. On line 1855 of Chef.java, there is this code:

    int type = JobEntryBase.getType(type_desc);
    if (type!=JobEntryInterface.TYPE_JOBENTRY_NONE) {
    ....do stuff
    }
    else {
    ....do nothing
    }

    The JobEntryBase.getType(type_desc) call will always return JobEntryInterface.TYPE_JOBENTRY_NONE unless it's a predefined job entry.

    Does this mean custom job entry plugins won't work?

    Thanks!

  4. #4
    Join Date
    Nov 1999
    Posts
    9,729

    Default RE: Job Entry plugin.

    Like I said before on this forum, the basics are there, but it was never tested.
    Up until now nobody seemed to have any use for it. I guess you're the first.

    So I guess, propose a code change and send it to me ;-)

    Thanks in advance for your understanding,

    Kind regards,
    Matt

  5. #5
    Join Date
    Sep 2005
    Posts
    1,403

    Default RE: Job Entry plugin.

    To fix the ability to drag the plugin onto the space, I made the newChefGraphEntry(String type_desc) function in Chef.java work more like it's counterpart in Spoon.java, by using the JobEntryLoader to find the job, instead of using the type integer:

    JobEntryLoader jobLoader = JobEntryLoader.getInstance();
    JobPlugin jobPlugin = null;

    try
    {
    jobPlugin = jobLoader.findJobEntriesWithDescription(type_desc);

    if (jobPlugin!=null)
    {
    // System.out.println("new job entry of type: "+type+" ["+type_desc+"]");

    // Determine name & number for this entry.
    String basename = type_desc;
    int nr = jobMeta.generateJobEntryNameNr(basename);
    String entry_name = basename+" "+nr;

    // Generate the appropriate class...
    JobEntryInterface jei = jobLoader.getJobEntryClass(jobPlugin);
    jei.setName(entry_name);



    This leaves the problem of all the places where the code finds the dialog for the job entry....this is less straightforward, since the JobEntryInterface doesn't have a method for getting the dialog, like the spoon plugin interface does. Adding that method would fix it, but require changing all the native job entry types by adding that method, which I'd rather avoid...

  6. #6
    Join Date
    Nov 1999
    Posts
    9,729

    Default RE: Job Entry plugin.

    This leaves the problem of all the places where the code finds the dialog for the job entry....this is less straightforward, since the JobEntryInterface doesn't have a method for getting the dialog, like the spoon plugin interface does. Adding that method would fix it, but require changing all the native job entry types by adding that method, which I'd rather avoid...




    Actually, there are not that many job entries at the moment (11) so that work is not that big. If it has to be done, it has to be done.

    The alternative would be to change the way of doing things and specify the classname of the dialog in plugin.xml as well.



    Thoughts?




    Matt

  7. #7
    Join Date
    Sep 2005
    Posts
    1,403

    Default RE: Job Entry plugin.

    I think adding that method to the interface would be cleanest, since it would be consistent w/ how the Spoon plugins work.

    To get things working, I created a new interface for plugin job entries:

    public interface JobEntryInterfacePlugin extends JobEntryInterface {
    public JobEntryDialogInterface getDialog(Shell shell,JobEntryInterface jei,JobMeta jobMeta,String jobName);
    }

    Then, added this to the newJobEntryDialog method of JobEntryBase.java :

    if (jei instanceof JobEntryInterfacePlugin)
    return ((JobEntryInterfacePlugin)jei).getDialog(parent,jei,jobinfo,"");

    This works w/out changing the native plugins, but definitely isn't as clean.

  8. #8
    Join Date
    Nov 1999
    Posts
    9,729

    Default RE: Job Entry plugin.

    I wonder whether or not we could get rid of the dialog specification at all by using reflection...
    Mmmm.

    Hey, do you need write access to the SVN repository? Send me some info on yourself (IM id's, time zone, e-mail, etc) and I'll add you to the team. Maybe that works a bit easier ;-)

    Cheers,

    Matt

  9. #9
    Join Date
    Jan 2008
    Posts
    18

    Default RE: Job Entry plugin.

    I stumbled over the same issue. It's very easy to write your own steps, annotate them, and use them. But creating your own job is basically not possible via annotation (PDI-511).

    Are there any news on that?

    Is it recommended to write own jobs (or better just create transformation)? What's today best practice to create custom jobs?

  10. #10
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    This was a 2-year old thread. I'm not so sure it was still relevant Ronny.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.