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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Alpha549
Creator II
Creator II

Run next subjob even if previous one got an error

Hello everyone,

 

 

I would like to be able to run a subjob even if the previous one got an error.

 

I know that I could use a tRunJob as a subjob, without checking Die on child error. I'm not in this case. The whole thing is in a unique job.

 

 

I thought about how to response to this need, and here is an example job :

 

 

0695b00000QCzmdAAD.png 

 

I would like to run tJava_5 even if an error occurs from tJava_1.

In tJava_2 et 6 I create an error.

 

 

Here is the code of each tJava :

 

tJava_1 : empty

 

tJava_2 : int i = 1/0;

 

tJava_6 : int j = 1/0;

 

tJava_4 : System.out.println("KO !");

 

tJava_5 : System.out.println("RUN ANYWAYS !");

 

 

Indeed, if an error occurs in tJava_2 or 6, tJava_4 is run, and then tJava_5, which is also run if there is no error, so from tJava_1.

 

 

 

I also tried this configuration :

 

 

0695b00000QCzmnAAD.png 

 

However, when I execute the job, it fails, tJava_4 is not executed. That's why I used onComponentError instead of onSubjobError.

 

So, here : I don't understand the use of onSubjobError. For any error occurring in tJava_1 subjob, it should run tJava_4, and then tJava_5.

 

 

Can you shed your light on my understanding ? 🙂

 

 

Thank you everyone !

Labels (3)
1 Solution

Accepted Solutions
gjeremy1617088143

Hi @Alpha549 Alpha549​ , in the second configuration , you will notice that on subjob ok link will work, cause on component ok link have high priority than on subjob ok , so it will execute first all the component linked by on component ok and if all components works fine no error are thrown so it can execute the on subjob ok link, the on subjob error link will not work cause it consider tJava_1 as a unique subjob, it will work if you put on component error link for all tJava(1,2,6) to tJava _4

View solution in original post

4 Replies
gjeremy1617088143

Hi @Alpha549 Alpha549​ , in the second configuration , you will notice that on subjob ok link will work, cause on component ok link have high priority than on subjob ok , so it will execute first all the component linked by on component ok and if all components works fine no error are thrown so it can execute the on subjob ok link, the on subjob error link will not work cause it consider tJava_1 as a unique subjob, it will work if you put on component error link for all tJava(1,2,6) to tJava _4

Alpha549
Creator II
Creator II
Author

Thanks a lot @guenneguez jeremy​ 

Ok the fact here is simply that each tJava is a subjob. Indeed, when I use another configuration :

 

0695b00000QD6AqAAL.png 

onSubjobError link works perfectly, so in the success case and error case, tJava_1 is executed 🙂

 

Topic solved ! 🙂

gjeremy1617088143

yes here it will work cause Talend consider tFixedFlowInput + the two tJavaRow as a unique subjob

Alpha549
Creator II
Creator II
Author

@guenneguez jeremy​ , just to know, do you know if there is a way to explicitely include a component in a subjob ?

For instance here, tJava is a subjob itself, but is there a way to include it in another subjob ?