Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: stop job on empty stream

  1. #1
    Join Date
    Oct 2011
    Posts
    2

    Default stop job on empty stream

    Hello,

    my problem is that I'm not able to stop the followig tranformation(s) in a job when the current transformations result is empty (0 rows). Is there a way to do this?

    Thanks in advance for answering.

    Holger

  2. #2

    Default

    It is not clear whether you want to stop within a job or right within a transformation because you do say "current transformation".
    I have attached a sample that shows how to abort within a transformation if one data stream is empty.

    I haven't tested this but you want to abort within the job then right after the empty transformation you would use the JavaScript step:
    http://wiki.pentaho.com/display/EAI/...ript+job+entry

    and use the "previous_result.getNrLinesWritten()" expression to get the number of rows coming out of the step.

    abort_on_zero_rows.ktr

    Run the transformation. If you leave the parameter at the default 0 then one stream will generate no rows and it aborts. If you fill in a non-zero value for the parameter then the transformation continues.
    Last edited by britebyte; 11-14-2011 at 05:00 PM. Reason: Missed some details.

  3. #3
    Join Date
    Oct 2011
    Posts
    2

    Default

    Hello,

    thanks a lot. That was exactly the step I've needed.

    Holger

Tags for this Thread

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.