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

Six 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 ?

Six 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.

2019 GARNER 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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch