exit job with routine

One Star

exit job with routine

Hello,
I created a java routine which show a msgbox and exit the job.
I use it in tMap in a condition like "If row1 == null then start routine"
My problem is that when the job finish with the routine, the 2 output files are created and i don't want it. The files are empty ,I checked "Don't create empty files" in the component settings but it don't work.
I also tried to add a File.delete() in the routine but it don't work.
Can anyone help me please ?
Jerem
One Star

Re: exit job with routine

Hi Jerem,
do you exit the job in your routine? If so, in which way?
Bye
Volker
One Star

Re: exit job with routine

Hi Volker,
Yes, i exit the job in the routine.
I use system.exit(0);
Jerem
One Star

Re: exit job with routine

Hi Jerem,
using System.exit() is a dangerous function ;-)
Using this will explain all your problems. If you do this call in the JVM it will immediately stop all processes. Even catch / finally blocks will never be reached. You should redesign your job to handle the wrong data. For example you could use a tFilterRow to check the value and let the wrong row run into a tDie.
Bye
Volker
One Star

Re: exit job with routine

Thanks for you help Volker, I built the job with TOS tools and it work well