Child job to update context variable

Highlighted
Five Stars

Child job to update context variable

I need to pass a value from my parent job to the child job, update it and pass it back to my parent job. 

 

I'm okay if this is either through context variable or through global variable.

 

In this scenario, after I transmit the value I force to child job to fail ( tDie). But I still need the updated value in my main job.

 

Can anyone help on how to achieve the same ?

 

 


Accepted Solutions
Community Manager

Re: Child job to update context variable

You cannot do this I'm afraid.

 

You can pass a context variable to a child job easily enough. 

You can pass the value back using a tBufferOutput component at the end of the child job. The value would need to be passed back as part of a datarow.

However, if you kill the child job with a tDie, it ends there and then. Why would you do this? You are essentially killing the Java execution of your program/job. You should only do this if you need the process to stop dead.

 

What you could try is sending the data back to the parent using the tBufferOutput and killing the job after this is done. That might work. The other thing you can try is to write the value out to a database or similar.

 

Unfortunately you cannot pass a context variable back to its parent without going through a convoluted process.

View solution in original post


All Replies
Community Manager

Re: Child job to update context variable

You cannot do this I'm afraid.

 

You can pass a context variable to a child job easily enough. 

You can pass the value back using a tBufferOutput component at the end of the child job. The value would need to be passed back as part of a datarow.

However, if you kill the child job with a tDie, it ends there and then. Why would you do this? You are essentially killing the Java execution of your program/job. You should only do this if you need the process to stop dead.

 

What you could try is sending the data back to the parent using the tBufferOutput and killing the job after this is done. That might work. The other thing you can try is to write the value out to a database or similar.

 

Unfortunately you cannot pass a context variable back to its parent without going through a convoluted process.

View solution in original post

2019 GARTNER 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

Talend Cloud Developer Series - Introduction

The Talend Cloud Developer Series was created to give you a solid foundational understanding of Talend’s Cloud Integration Platform

Watch Now

Talend Cloud Available on Microsoft Azure

An integration platform-as-a-serviceto help enterprises collect, govern, transform, and share data from any data sources

Watch Now

Self-service Talend Migration: Moving from On-Premises to the Cloud

Move from On-Premises to the Cloud by following the advice of experts

Read Now