Hitachi Vantara Pentaho Community Forums
Results 1 to 1 of 1

Thread: job javascript and previous_result

  1. #1
    Join Date
    Mar 2007
    Posts
    2

    Default job javascript and previous_result

    Hi everyone,

    Have been trying the following main.kjb job:

    Start -> Transformation -> JavaScript -> End (see image)

    In the JavaScript I used the following snipplet as described in:

    * http://wiki.pentaho.com/display/EAI/...ript+job+entry
    * see Spoon-documentation: ( 13.2.6.3. Exposed variables - Page 206 )
    * see javadoc: Result-class

    The JavaScript I use is:

    --snip
    parent_job.setVariable("stats.output.standard.in",previous_result.getNrLinesInput());
    parent_job.setVariable("stats.output.standard.out",previous_result.getNrLinesOutput());
    parent_job.setVariable("stats.output.standard.filesin",previous_result.getNrFilesRetrieved());
    parent_job.setVariable("stats.output.outdb.updated",previous_result.getNrLinesUpdated());
    parent_job.setVariable("stats.output.outdb.rejected",previous_result.getNrLinesRejected());
    parent_job.setVariable("stats.output.outdb.read",55);
    parent_job.setVariable("stats.output.outdb.written",previous_result.getNrLinesWritten());
    parent_job.setVariable("stats.output.outdb.error_cnt",previous_result.getNrErrors());
    previous_result.getResult() <- As described in the tutorial evaluates to true if a Result was created.
    --snap

    In the end I can read all the variables that I declared within the parent_job but the only value that is transported correctly is the "55" which I set for stats.output.outdb.read, the rest of the Values return 0.

    My question is: Has anybody done this before? If yes, how.
    Or if no, is there another possibility?

    Kind regards,

    Fabian
    Attached Images Attached Images  

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.