Seven Stars

exiting a job under certain conditions

Hello everyone

I have a requirement in TalenDI 6.4 to exit the job without doing any work under certain conditions.

Example: Job reads a value from a database and if the value is not found (or a certain value or null is returned) then simply exit job.

So it is not error condition, I don't want to crash the job, I simply do not want it to proceed any further from this point onwards.

What is the easiest way to deal with this?

I am not sure if calling System.exit() from tJava is a good idea or even supported by Talend DI ?

I guess I am looking for something like tJobExit (which does not seem to exist in DI 6.4.1).

thanks!

 

 

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Six Stars

Re: exiting a job under certain conditions

Hi YuriB,

You can set the condition in the tMap expression filter -- ((Integer)globalMap.get("<dbcomponent>_1_NB_LINE")) > 0.

It will check the number of records returned by the database component. If it's null it will not proceed further.

 

Best Regards,

Abhishek

 

2 REPLIES
Six Stars

Re: exiting a job under certain conditions

Hi YuriB,

You can set the condition in the tMap expression filter -- ((Integer)globalMap.get("<dbcomponent>_1_NB_LINE")) > 0.

It will check the number of records returned by the database component. If it's null it will not proceed further.

 

Best Regards,

Abhishek

 

Seven Stars

Re: exiting a job under certain conditions

thanks, I will check this out.