Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: pre defined funtions in JS

  1. #1

    Default pre defined funtions in JS

    Dear all

    i want to write a js function in mod java script which can be reused in other steps (mod java script) of the same transformation

    for example some function like the lenth of a particular field to be checked not to exceed a certain value...

    function lengthCheck(var fieldname, var fixlength)

    which return boolean checking the length has exceded certain value fixed length mentioned.

    is this possible in mod java script step ... and how can i reuse this function in other mod java script steps..
    Has any one implemented any thing of this sort in there transformation..

    Thanks in advance.

    sarat kiran

  2. #2
    Join Date
    Sep 2007
    Posts
    834

    Default

    To reuse something in a transformation, you should move the functionality to a sub-transformation (mapping).

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

    Default

    You can also use the "LoadScriptFile()" function.

    Code:
    LoadScriptFile("/foo/bar/script.js");

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.