Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Running a Job which uses Kettle variables in Java

  1. #1
    Join Date
    Feb 2011
    Posts
    6

    Default Running a Job which uses Kettle variables in Java

    I have a Job which contains a 'Check if Folder empty is Empty' step. In the folder name field I am using '${LOG_SOURCE_LOCATION}' variable (which is defined in .kettle/kettle.properties). When I run this Job in Spoon, it works fine. But when I run it through Java, it says 'we can not find [${LOG_SOURCE_LOCATION}] !'. Where should I specify the value of this variable to make it work? Following is my Java code to call the Job.

    Code:
    KettleEnvironment.init();
    EnvUtil.environmentInit();
    JobMeta jobMeta = new JobMeta(fileName, null);
    jobMeta.setInternalKettleVariables();
    Job job = new Job(null, jobMeta);
    job.execute(0, null);
    job.waitUntilFinished();

  2. #2
    Join Date
    Mar 2010
    Posts
    159

    Default

    Do you have a KETTLE_HOME set before invoking the java? If not, any chance the user is different when executing the java?

    Regards,
    Jeremy

  3. #3
    Join Date
    Mar 2008
    Posts
    140

    Default

    ricky,

    Repost your question on the developer mailing list, you should get some good results that way.

    -Curtis

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.