One Star

How to exit job from tPreJob?

We have a job that performs some preparation/configuration in a tPreJob prior to the main part of a job. In case of errors in the tPreJob, we use tDie to stop the job. Unfortunately, the job doesn't die and the main part of the job still executes. How can we make sure the job dies in a tPreJob?
/tomte
7 REPLIES
One Star

Re: How to exit job from tPreJob?

Hi
It is because the tPrejob_1Process() method and the tJava_1Process() are called separately in the runJobInTOS() method.
They are in two try-catch-finally blocks.
The solution is to select the "Exit JVM immediately" option in tDie->Advanced Settings.
Regards,
Pedro
One Star

Re: How to exit job from tPreJob?

Hi,
thaks for the answer. We tried your solution. Unfortunately, our JBoss-server shuts unexpectedly down now. (We need to deploy the job as a web service). This solution is not really a step forward for us! What else can we do?
/tomte
One Star

Re: How to exit job from tPreJob?

Hi
Sorry. I didn't know you wanted to deploy it on JBoss.
It seems the code System.exit(4) makes JBoss shut down.
Now another workaround is in the main part you might link some components with tDie by using the Run-if trigger.
Modify the if condition: ((Integer)globalMap.get("tDie_1_DIE_CODE"))==4.
Regards,
Pedro
One Star

Re: How to exit job from tPreJob?

Hi TalendJoda,
unfortunately, our cool vendor doesn't support higher versions of JBoss.
/tomte
One Star

Re: How to exit job from tPreJob?

Hi
It is because the tPrejob_1Process() method and the tJava_1Process() are called separately in the runJobInTOS() method.
They are in two try-catch-finally blocks.
The solution is to select the "Exit JVM immediately" option in tDie->Advanced Settings.
Regards,
Pedro

Thanks. It worked.
One Star

Re: How to exit job from tPreJob?

How can we accomplish this via the talend data mapper?
Four Stars

Re: How to exit job from tPreJob?

Hello,

 

For me it doesn't work because i want to execute the tPostJob even tDie quit tPreJob.

The only solution i found is to put a component (tWarn or tJava) starting the job an linking it to the real start with an if link (condition : no error message, for example)

:-(