Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
rchanda
Contributor II
Contributor II

Talend Conditional Flow and Exit

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

Labels (2)
1 Reply
Anonymous
Not applicable

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