How to stop job execution if a parameter is null

One Star

How to stop job execution if a parameter is null

Hello,
In my job I've a parameter to define the file name and pass it's value using the command line. But I need to check if the value passed isn't null and if it's null the job must stop it's execution.
How could I do that? I try to use tAssert but it didn't work.
Regards,
Felipe Cypriano
One Star

Re: How to stop job execution if a parameter is null

Can't you use
rightclick -> events -> execute if
and write your if statement?
One Star

Re: How to stop job execution if a parameter is null

Thanks hammerwd,
I was using onSubjobOk with the tAssert, now I changed it to Run If and write the if condition - again - in the if.
One Star

Re: How to stop job execution if a parameter is null

Now only one problem still there. How could I set an else statement? Because I need to return an error code when the if is false, the caller must know that the operation failed.
One Star

Re: How to stop job execution if a parameter is null

Hmm .. I didn't do it before, but maybe you can use two if
first the valid:
if value != 0 and than do some jobs
and a second if:
if value == 0 than send mail or something like this.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Downloads and Trials

Test drive Talend's enterprise products.

Downloads