Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: how to load javascript function at beginning of transformation

  1. #1
    Join Date
    Aug 2007
    Posts
    3

    Default how to load javascript function at beginning of transformation

    Hello,

    In the LoadScriptFile_Sample javascript is says
    This function should called from your defined StartScript otherwise your JavaScript-File is loaded on each processing Row.
    How and where do I do this?

    Thanks,
    Martin

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

    Default

    Click right on the script tab. Select "Set start script".

  3. #3
    Join Date
    Feb 2011
    Posts
    152

    Default

    In my testing with this, when I put the LoadScriptFile() in my startup script, it only gets executed once. Is there a way to load a script once, but have it be executed for every row? -- effectively load it into tho transformation context from the startup script. I tried putting the LoadScriptFile() in the transform script and it worked, but it also had to load it for each row. Is there a way to do this?

  4. #4
    Join Date
    Sep 2009
    Posts
    810

    Default

    Maybe change the script you load in the start script so it becomes a library that you can invoke using a function call, and then call that function in the row script?

  5. #5
    Join Date
    Feb 2011
    Posts
    152

    Default

    That works.
    Last edited by dnrickner; 05-10-2012 at 09:03 AM.

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.