Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello community,
I need your help 🙂
I created a flow which is calling API using tREST component (See flow.jpg).
I am looping till I don't get any result from the page (to end the loop) (see tJav
.jpg
a loop.jpg)The API often timeout so I would like to implement a retry option.
Any hints how I could do it ?
yes, if you need to pass value from main job to child job, you need to define context variable in child job, and select the variable on tRunJob to receive the value. Let me know if you have any more questions.
Hi
When timeout occurs and the job fails to run, to retry the API call, move this part to a child job, use a trunJob to call the child job and uncheck the 'die on error' option.
Define a global variable that both of main job and child job can access it, this variable is used on tLoop as you did now. In the child job, set the value of global variable to true when an error occurs.
Regards
Shong
Thank you Shong.
I think I am doing something wrong - could you please tell me how to create a child job and use tRun to call it?
Create a new job, then copy the components I mentioned and paste them to the job. In the original job, use a tRunJob component to call the new job.
If you need to pass some value from main job to child job, please refer to this article.
Thank you again! though I have more questions, sorry 😞
in the main job I have to pass two values: id and loop which are not context variables.
In the Tjava in the main job I print out:
globalMap.get("id"));
globalMap.get("tLoop_2_CURRENT_ITERATION");
looking at the article it seems that I have to define :
id
tLoop_2_CURRENT_ITERATION
in the context as , for example: context.id
is that correct?
yes, if you need to pass value from main job to child job, you need to define context variable in child job, and select the variable on tRunJob to receive the value. Let me know if you have any more questions.