how to retry certain times?

One Star

how to retry certain times?

I use tRest to call web service, according to the return result , if error,retry 10 times ;else empty or has data, write to csv.
How do i design the job structure ? I am a bit confused with the different connections.
Community Manager

Re: how to retry certain times?

Hi  
Try to design the job looks like:
main job: define a context variable called condition, this variable will be used for the condition on tLoop component. 
tLoop--iterate--tRunJob--oncomponentok--tjava1
                                  --oncomponenterror--tjava2
on tLoop: set the condition field with context variable: context.condition.
on tRunJob: call the child job, check the 'die on error' option.
on tJava1:
context.condition=false;
on tJava2:
if(iteration_number<11){
context.conditon=true;
}else{
context.conditon=false;
}
child job:
tRest--main--tlogRow
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business