Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Help me, load job from existing of reposiotry!

  1. #1

    Default Help me, load job from existing of reposiotry!

    Hello Matt and all!
    I read attentively Pan.java, and did not understand, how get job from repository and execute....
    I load plugin.... But i get exception...
    An error occurred reading job [CDR] from the repository

    Unable to load job entry of type 'trans' from the repository for id_jobentry=6

    offending row : [ID_JOBENTRY= 6, CODE=name, NR= 0]

    Error setting value #1 [ 6] on prepared statement (Integer)
    java.lang.NullPointerException
    My code..
    for (int i = 0; i < rep.getJobNames().length; i++) {
    jobPlugin = jeloader.findJobEntriesWithDescription(rep.getJobNames()[i]);
    JobMeta jobMeta = new JobMeta(logKettle, rep, rep.getJobNames()[i], repDir);
    Job job = new Job(logKettle,steploader,rep,jobMeta);

    job.execute();
    }

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

    Default

    This is the constructor you need to load a JobMeta object from the repository:

    Code:
        /**
         * Load a job in a directory
         * 
         * @param log the logging channel
         * @param rep The Repository
         * @param jobname The name of the job
         * @param repdir The directory in which the job resides.
         * @throws KettleException
         */
        public JobMeta(LogWriter log, Repository rep, String jobname, RepositoryDirectory repdir) throws KettleException
    The directory can be obtained like this:

    Code:
    RepositoryDirectory directory = rep.getDirectoryTree().findDirectory("/foo");
    HTH,

    Matt

  3. #3

    Default

    I understand nothing, practically changing nothing all began to work. All appeared much simpler. I got DirectoryRepository:
    Code:
     Repository rep = new Repository( LogWriter.getInstance(LogWriter.LOG_LEVEL_DEBUG)
                                        ,rpMeta,userKettle);
                    rep.connect(false, true, dbMeta.getName());
                  repDir =  rep.getDirectoryTree();
    after :
                    for (int i = 0; i < rep.getJobNames().length; i++) {
                       System.out.println("Job name - >"+rep.getJobNames()[i]);
                       JobMeta jobMeta = new JobMeta(logKettle, rep, rep.getJobNames()[i], repDir);
                       Job job = new Job(logKettle,steploader,rep,jobMeta);
                       job.execute();
                    }
                } catch (KettleException ex) {
                    ex.printStackTrace();
                }
    But, this bug IDE.... or my ;-)
    Many thanks that you expended time in my person.
    Last edited by MattCasters; 10-12-2007 at 11:26 AM.

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

    Default

    No problem!!

    Would you be interested in helping get Kettle translated in your own language? (Russian?)
    If so, look here and download the translation package.
    Add your locale to translator.xml and off you go.

    Take care,

    Matt

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.