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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
mr_burns
Contributor
Contributor

tJavaRow - how to exit job but run tPostJob?

Hi,

this is a part of my job:

0695b00000bGjgRAAS.png 

tJavaRow_1 should end/quit the job if a certain condition is met.

I tried using:

 

if (whatEverCondition == true)

System.exit(1);

 

Basically this is working but the problem is that tPostjob_1 is not executed anymore and so the end time of the job is not written to DB anymore.

 

Please note:

I cannot use a tDie component because this will cause an exception which is caught by my tLogCatcher what I don't want since no execption takes place just a condition to end the job.

I also cannot deactivate 'Catch tDie' in tLogCatcher basic settings since I have other tDie components in my job which need to be caught by tLogCatcher.

Basically I need a tQuit or tEnd component 😉.

 

How can I quit a job using Java code (inside tJavaRow_1) but still run tPostJob_1?

 

Thanks for any help!

Labels (3)
3 Replies
Anonymous
Not applicable

System.exit(1) is not the best way to safely end a job on a condition having been met to end it. Can you explain what the condition is and why you need to do this?

Anonymous
Not applicable

Have you tried to use:

return;

That should quit from the actualy function. But postjob should still execute.

 

One can use continue; to skip the components on the "right" side of the flow for the entry.

Anonymous
Not applicable

Great idea! I hadn't thought of attempting this.