Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: passing input to the transformation from java

  1. #1
    Join Date
    Jun 2009
    Posts
    26

    Default passing input to the transformation from java

    Hi,

    I have an ktr file, having excel input and excel output, i want to give the input for 'excel Input' from java..

    For that i have imported the ktr file to eclipse, i dunno how to pass the input excel file to the existing transformation in java..

    Which method we can use, any idea pls..



    thanks,
    kaleesh

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    You specify the full path to the excel file in the excel input step...

    In case you want to feed the data directory from java to the ktr you don't need the excel input step of course, there are other steps that can inject rows into a transformation, for that the best would be to look at the unit test cases in which a lot of them do such a thing.

    Regards,
    Sven

  3. #3
    Join Date
    Jun 2009
    Posts
    26

    Default

    Hi Sven,
    Could you please clarify as where can i find those unit test cases?

    Any link available for that....


    And also i want to send the path of the xml file to be taken as input for the "get data for xml" from java..

  4. #4
    Join Date
    May 2006
    Posts
    4,882

    Default

    The test cases are in the regular source tarball of PDI... directory test.... you can get it e.g. at sf.net

    if you everything in java (not using .ktr files) you can get at the meta-data of the steps and put the data you want in there. If you just use java to run .ktr files you can use variables to set some pieces of data.

    Regards,
    Sven

  5. #5
    Join Date
    Jun 2009
    Posts
    26

    Default

    Any example there (use variable to set data)...

    regards,
    kaleesh

  6. #6
    Join Date
    May 2006
    Posts
    4,882

    Default

    Use something as ${variable_name} in your transformation (for the path the excel file e.g.), and then later on when executing the .ktr from java you can "inject" a value for variable_name.

    Regards,
    Sven

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.