Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: about after N failed attempts

  1. #1

    Default about after N failed attempts

    Hi -

    I need to exit a looping job after 5 failed attempt run the job inside the loop.

    The inner job succeeds or fails based on a touch file's existence.

    Before entering the loop I set a varable - Attempts - to 0

    In the inner job, I increment this variable if the touch file exists and expect the job to evaluate 'false'. The transformaiton run when the file exists is simple ...

    Get ${Attempts} >> Java Script Value >> Set {$Attempts}

    The Javascript thingee contains
    ______________________________________
    var Cnt = Attempts.getInteger();
    Cnt = Cnt + 1;
    if (Cnt >= 5){
    (1==0); //should return false
    }
    _______________________________________

    Am I missing something here?

    Thanks

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    In 2.5 with variables it probably fails. It may even fail on v3.0.

    Variables are inherited "by value". If you change them in a lower job this will not affect the jobs above. If you want to change the variables as well you have to use set variable step to set the value in parent jobs/transformations/...

    Regards,
    Sven

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.