Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Access a variable in javascript from kettle job?

  1. #1
    Join Date
    Apr 2007
    Posts
    2,010

    Default Access a variable in javascript from kettle job?

    Hi,

    Can I access a variable from javascript in a kettle job step? I tried the usual getString() but that didnt work -it said var is not defined.

    I want to conditionally run a different transformation based on the setting of the variable. I've managed to pass in the variable from my xaction, that works fine.

    Thanks,
    Dan

  2. #2
    Join Date
    Sep 2007
    Posts
    834

    Default

    hi, Dan

    I've never used the javascript Job Step. In order to do what you're trying to do, I use to set a variable with the name of the transformation to run.
    Then, in the textbox "Transformation Filename" of the Transformation Step, I use the variable (${MY_TRANSF})


    Quote Originally Posted by codek View Post
    Hi,

    Can I access a variable from javascript in a kettle job step? I tried the usual getString() but that didnt work -it said var is not defined.

    I want to conditionally run a different transformation based on the setting of the variable. I've managed to pass in the variable from my xaction, that works fine.

    Thanks,
    Dan

  3. #3
    Join Date
    Apr 2007
    Posts
    2,010

    Default

    I tried that but had no joy, i get lots of errors!

    Perhaps i have the format wrong? I've attached a pic of the transformation settings...

    I'm encouraged to know it can be done like that though!

    not a very good pic, but the filename is set like so:

    solution:/transformations/${transformationName}

    The errors relate to not being able to load the xml.
    Attached Images Attached Images  
    Last edited by codek; 09-10-2008 at 09:46 AM.

  4. #4
    Join Date
    Apr 2007
    Posts
    2,010

    Default

    sorry my mistake it does work fine.

    I was trying to use xaction solution: syntax and that doesnt appear to work.

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.