Catch the return code from Talend in shell script in unix

Highlighted
Five Stars

Catch the return code from Talend in shell script in unix

Hi,

I have developed Talend job in Windows Talend .I am able to run job properly as per logic .

Also I have used tlogcatcher to record errors and I am able to get records in stats table using project setting option.

 

Now, I have to run the job on Linux machine.

But, When i build the job and try to run that using shell script I am getting job status as completed (using echo $?)

even if there are error (or exist status of job is 1). Also I am not getting error records in stats table.

Kindly suggest me the way to get exit status of Talend job in unix script and also how to get records in stats table using shell script

 

any example, will be highly helpful.

---
Don't forget to give kudos when a reply is helpful.
Thanks
Fifteen Stars TRF
Fifteen Stars

Re: Catch the return code from Talend in shell script in unix

If you want to exit from your job with a return code different of 0 (the default), you need to use System.exit method:

System.exit((Integer)globalMap.get("returnCode"));

In this example, the global variable "returnCode" has been set somewhere in the job and in case of tDie or Java exception, the tLogCatcher subjob will call System.exit to exit with the specified return code.

 


TRF

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

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