Five Stars

Loop a subjob n times if exit code is not 0

I am trying to execute a code in tsystem and then depending on exit code i am taking relevent steps.

Now if the exit code is not 0 i want to retry executing it 5 times and even after 5 times if the error code is not 0 i  don't want to execute any more and move to other part of job.

 

How can i achieve this. Any help appreciated.

Tags (1)
1 REPLY
Twelve Stars TRF
Twelve Stars

Re: Loop a subjob n times if exit code is not 0

Hi,

Using a tJava component in the loop, you may count the number of retry and store the result in a global variable (let's say "your_retry_count").

Now you can have a tLoop (type While) with the following condition:

((Integer)globalMap.get("tRunJob_1_CHILD_RETURN_CODE")) != 0 && ((Integer)globalMap.get("your_retry_count")) < 5

Should works.

 


TRF