Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Friends,
I need help with conditional flow in talend open studio 6.5.1. My requirement is to check a condition (DB value), if condition is met then exit the job (Stop executing the job and quit), if the condition is not met then sleep for 30 seconds and check the condition again, repeat the checks for 3 times. If condition is met the job should quit, if not check again.
Please help me with some ideas how to quit the job and how to check the condition 3 times.
Connect me to any link if you know.
Thank you in advance
Hi
You can use tInfiniteLoop to repeat the checks for N times, and use tDie to stop the job if the condition is met. The job looks like:
tInfiniteLoop--iterate--check your DB value and set the value of a context variable (boolean type) to true or false based on DB value) on a tJava or tJavaRow--runIf--tDie
Set the condition of runIf as:
context.result==true||((Integer)globalMap.get("tInfiniteLoop_1_CURRENT_ITERATION"))==3
// ((Integer)globalMap.get("tInfiniteLoop_1_CURRENT_ITERATION")) is a global variable pre-defined on tInfiniteLoop, it counts the current iteration.
Please try and let me know if you still have any questions/concerns.
Regards
Shong