Return value from Talend Job

Seven Stars

Return value from Talend Job

Hi,

 

Our requirement is when Talend job successfully complete without any error,Then Talend graph should return 1 so this number can be accepted by another script and can perform other activity.

How to achieve this requirement in Talend. Please assist.

 

Regards,

Vivek

Forteen Stars

Re: Return value from Talend Job

@vivek_u ,if you want to return the values ,then you can use tJava component on success of the the job and print the value which wan to return.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Seven Stars

Re: Return value from Talend Job

Hi,

 

Where to put t java component and where to find event called 'on success of the the job' Can you elaborate and show how to design that.

 

Regards,

Vivek

Six Stars

Re: Return value from Talend Job

I assume you run Talend through unix environment as exported job. 

 

When calling the talend job

./talendjob.sh

result = $?

 

or 

 

result= ./talendjob.sh

 

Now result would hold either 1 or 0 depending of the success of talendjob.sh

Seven Stars

Re: Return value from Talend Job

Thanks Vignesh.

However we would like to know how to achieve this is in Talend job (related design and on which event) ?

 

Regards,

Vivek

Six Stars

Re: Return value from Talend Job

Hi, 

 

How are you planning to deploy and run the job in PROD? after development. 

 

That plan is needed to get information of triggering another job on this jobs success or failure

 

If you are going to trigger another TalenD job then you can have job 1 and job 2 as sub jobs in job 3. with condition tigger "on  subjob OK" linked from job 1 to job 2. use tRunJob component to create subjobs in talend. 

 

 

Eleven Stars

Re: Return value from Talend Job

Are you looking for execution Plan on TAC ?

 

https://help.talend.com/reader/GL_4g5KgOuy9xQdPC2EzSQ/y0Us7J_ukdgxhe9Jx_o_NQ 

Regards
Abhishek KUMAR
Seven Stars

Re: Return value from Talend Job

We have only one main job where all components are designed.

Seven Stars

Re: Return value from Talend Job

This is not working... subjob ok is always executing only one condition even component thrown error as well

Employee

Re: Return value from Talend Job

Hi,

 

    Did you print and verify the value which is getting returned from the job?

 

    Based on the return value, if you want to trigger another job, you can also try Run if condition.

 

     Say, run Job B if return value is 1. Run Job C if return value is 0.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)

 

Seven Stars

Re: Return value from Talend Job

There is only one graph with 4-5 component if any component is throwing exception then graph should return 0 otherwise 1.

Highlighted
Employee

Re: Return value from Talend Job

Hi Vivek,

 

     We are helpless unless you are ready to provide more information about your job flow. Could you please provide your current job flow, the input data and the expected output data and the expected return value details? Also please advise how you are planning to schedule it and what are you trying to say when you are mentioning "Talend graph"? Is it the flow of the job or are you mentioning about visual graphs?

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)

Forteen Stars

Re: Return value from Talend Job


@vivek_u wrote:

There is only one graph with 4-5 component if any component is throwing exception then graph should return 0 otherwise 1.


Hi,

try to think different

 

by default (and always) - each program which finished successfully return 0, and bash, talend, powershell and etc can manage this values

 

if job finished without error - it automatically returns 0

if you need return any other code - use tDie with preferred code (it could be more than 1)

-----------

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

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download