Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Labels (2)
7 Replies
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

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

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.
_AnonymousUser
Specialist III
Specialist III

How can we accomplish this via the talend data mapper?
philippert
Contributor
Contributor

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)

😞