How do I manually trigger an OnSubJobError/OnComponentError of a tRunJob from within the sub Job itself

Five Stars

How do I manually trigger an OnSubJobError/OnComponentError of a tRunJob from within the sub Job itself

I have a main Job that orchestrates between about six sub job depending of the File type it receives.

The sub job processes multi-level XML file and do a whole lot of business data validation across levels etc....

I manually record in the talend log the business error that are found with the following statement called from tJavaRow components.

 

talendLogs_LOGS.addMessage("tJavaRow", "CSML_val", 5, error, 300); 
talendLogs_LOGSProcess(globalMap);

 This actually work very well.

By removing the Die on Child Error flag on the tRunJob it allows me to go through the business logic encapsulated in the sub job and get all errors instead of quitting on the first error. So I've in effect delayed the determination of error until the PostJob of the sub job.

 

My Issue now is that if there are one or more errors I want to trigger the OnSubJobError or OnComponentError of the parent's tRunJob to do the common clean up.

 

But whatever I do playing with status or errorCode or manually throwing an exception or setting things like

tJavaRow_4_error(myTE, currentComponent, globalMap);

 None of that works!

Hence my question: How do I manually trigger an OnSubJobError of a tRunJob from within the subJob itself??

Employee

Re: How do I manually trigger an OnSubJobError/OnComponentError of a tRunJob from within the sub Job itself

If you can send screenshot of you jobs would be more clear. But from what I understood , "have you tried utilising 'Run If' triggers to somehow fool 'OSE' or 'OCE' trigger invoking lets say via a dummy component like tJava or something ...and try evaluate your conditions or values in RUN-IF then handover control to OSE OCE...does that makes sense ?

Five Stars

Re: How do I manually trigger an OnSubJobError/OnComponentError of a tRunJob from within the sub Job itself

Thank you snayak

I did think about it and will probably try is in the next few days. It's not as elegant as I would have liked but I need a solution now.

Thank you again.

 

I'll let you know.