How to rerun the failed child job

Seven Stars

How to rerun the failed child job

 

Hi,

 

I got to know that we can rerun failed jobs by going through Talend community discussions. However, I did not get how to implement this. Can anyone guide me doing this?

 

Thanks in advance,

Meghana.


Accepted Solutions
Community Manager

Re: How to rerun the failed child job

You could use a tLoop. This is very simple to do, but you have to be precise with how you implement it and will have to think about the possibility of continuous loops. A screenshot of my example job can be seen below...

Screen Shot 2018-09-28 at 12.56.39.png

 

The code in the tJava_1 is below....

globalMap.put("loop", true);

The tLoop is configured with a While loop which has this code in the condition...

((Boolean)globalMap.get("loop"))

The tRunJob is configured NOT to die on child error. 

The RunIf is configured with this code....

((Integer)globalMap.get("tRunJob_1_CHILD_RETURN_CODE"))==0

The tJava_2 is configured with this code....

globalMap.put("loop", false);

Essentially what I am doing is setting the tRunJob to keep running until it finishes with a return code of 0 (success). You will have to keep in mind that this (as I have shown you) will keep trying forever. To limit the number of retries you could alter the tLoop to be based on the success boolean AND a count of tries.

View solution in original post


All Replies
Forteen Stars

Re: How to rerun the failed child job

@MeghanaKottala,you can restart from the node in TAC.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Seven Stars

Re: How to rerun the failed child job

Sorry, I did not get u.

 

I have my parent where I included some child jobs. I will push my parent job to Talend cloud. I want my child job to re start automatically when it fails.

 

I have gone through discussions and came to know that we can do this using child job return code value. But I do not know how to implement this in my job.

 

 

Thanks.

Community Manager

Re: How to rerun the failed child job

You could use a tLoop. This is very simple to do, but you have to be precise with how you implement it and will have to think about the possibility of continuous loops. A screenshot of my example job can be seen below...

Screen Shot 2018-09-28 at 12.56.39.png

 

The code in the tJava_1 is below....

globalMap.put("loop", true);

The tLoop is configured with a While loop which has this code in the condition...

((Boolean)globalMap.get("loop"))

The tRunJob is configured NOT to die on child error. 

The RunIf is configured with this code....

((Integer)globalMap.get("tRunJob_1_CHILD_RETURN_CODE"))==0

The tJava_2 is configured with this code....

globalMap.put("loop", false);

Essentially what I am doing is setting the tRunJob to keep running until it finishes with a return code of 0 (success). You will have to keep in mind that this (as I have shown you) will keep trying forever. To limit the number of retries you could alter the tLoop to be based on the success boolean AND a count of tries.

View solution in original post

Seven Stars

Re: How to rerun the failed child job

Thanks..!!!!

It's working.

 

 

Thanks,

Meghana.

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now

Getting Started with APIs

Find out how to get started with APIs

Read