Returning Values from Child Job to Parent Job in Talend

Posted on by By admin, in Talend | 0

It is always a common phenomenon to pass values or variables from parent job to child job in different scenarios in talend. But sometimes, you may need to return values from the child job to parent job too.

Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.

This blog discusses a method to return values from child job to parent job in talend.

Returning values from child job to parent job is possible with a tBufferOutput component.

Example Scenario: Parent job sends input value to a child job which finds the square root of the input value and returns it to the parent job.

Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.

Parent job:
Parent Job

tFixedFlowInput_1: Fetches the input value for which the square root has to be returned.
Input Value

tJavaRow_1: Loads the input value into a context value : context.value
tJava Row

tRunJob_1: Child job is called in tRunJob_1. The input value is transmitted into the child job through the context value.
tRun Job

Child Job: Child job calculates the square root value of the input sent from the parent job. This square root value is returned to the parent job using tBufferOutput component.
child job

tFixedFlowInput_1: Fetches the input value from the context.value sent from the parent job.
fetching input value

tJavaRow_1: calculates the square root value and sends it to the buffer output component.
Finding Square Root

tBufferOutput component sends the output value sqrt_value to the parent.

Square Root Value

tBufferOutput component buffers the records in the child job and the tRunjob component in the parent job reads the records from the buffer and passes it to the next component.

**** Note: tRunJob_1 in the parent job should have the same schema as that of tBufferoutput_1 in the child job to get the value returned by the child job.
Schema tRun Job

The square root value is printed in the parent job in tJavaRow_2.

After execution: The parent job returns the output returned by the child job.

Make data easy with Helical Insight.
Helical Insight is the world’s best open source business intelligence tool.

Claim Your 30 Days Free Trail

Job Return

Note: **This is a great way to return row data. It is not the most appropriate way for returning control or status data.**

logo

Best Open Source Business Intelligence Software Helical Insight is Here

logo

A Business Intelligence Framework

In case if you have any queries please get us at support@helicaltech.com
Thanks
G R Rajitha
BI Developer
Helical IT Solutions Pvt Ltd

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments