Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Running two sub jobs parallel

Hi ,
PLease let me know how I can run two jobs parallel in talend job?


Thanks and Regards,
Biswajit
Labels (2)
22 Replies
Anonymous
Not applicable
Author

Hi,
I think you should create a Parent job for your First Subjob and then create a Child job for only two parallel sub jobs(use multithread execution in Child job ). So that the scenario when First Subjob completes then only two parallel sub jobs can start can be achieved.
Please see the component reference with related scenario tRunjob. It will be helpful for your job design.
Best regards
Sabrina
Anonymous
Not applicable
Author

Hi Sabrina,
Thanks for the reply.
But the issue with tRunJOb is that if in PArent job I am setting any global variable then how I can get it in my child job?
Please let me know how I can pass global variable values from Parent Job to Child jobs?
Thanks and Regards,
Biswajit
Anonymous
Not applicable
Author

Hi,
The effective scope of a variable is limited to a specific Job, meaning that the variables defined in one Job can't be accessed from other Jobs. If you want to share the same value between different Jobs, you must define context variables in each Job and then pass the value between them.
See the related reference Passing a value from a parent Job to a child Job
Best regards
Sabrina
Anonymous
Not applicable
Author

Thanks for the reply Sabrina.

It proved a Great help to me :-)
I need one more help like Now I want to pass the value from child to parent . How I can do that?
Is there any other approach?

Thanks and Regards,
Biswajit
Anonymous
Not applicable
Author

Hi,
To pass a value from child job parent job, you can use tBufferOutput component, please refer to
https://community.talend.com/t5/Design-and-Development/resolved-How-to-pass-values-from-child-job-to...
Let us know if you still need any help!

Best regards
Sabrina
Anonymous
Not applicable
Author

Thanks Again for such a quick reply.
The link which u gave shows how I can pass the variables from Runjob1 to Run job 2. but my issue is how I can get back the status if the sub job run successfully? I want to catch value from my sub job to my Parent Job.

Thanks and Regards,
Biswajit
Anonymous
Not applicable
Author

Hi,
In https://community.talend.com/t5/Design-and-Development/resolved-How-to-pass-values-from-child-job-to..., second floor, shong has replied an answer with a related forum https://community.talend.com/t5/Design-and-Development/Passing-context-parameters-in-a-tRunJob/td-p/..., which is the key one I want to show you.
If you still don't understand it after reading the related forum, I will design a demo job and send the job .zip file to you, don't be worried about it.
Best regards
Sabrina
Anonymous
Not applicable
Author

Hai Sabrina,
Thanks for reply and help.
Can you please share me the demo job. I am still unable to get the output back to parent job from child job.

Thanks and Regards,
Biswajit
Anonymous
Not applicable
Author

Hi,
Returning a value from child job to parent job
We will read data from a text file as below in a child job. And populate the total number of rows and pass it to the parent job.
in.txt:
id;name
1;Shong
2;Ross
3;Patrick
First Step
Create a job: let's call it 'ChildJob'. The job design looks like 0683p000009MPcz.pngpic1)
The components' settings are as below(pic2,3,4)
Second Step
Create a job: let's call it 'ParentJob'. The job design (as below) is called the child job 'ChildJob' on tRunJob_1(pic5)
tJavaRow's setting(pic6)
code on tJavaRow:
System.out.println("The total number of rows is:"+input_row.nb_line);

Third Step
Execute the job; The console has the following output result:
1|Shong
2|Ross
3|Patrick
The total number of rows is:3
Summary
Through the example above, we can see that the most important technical point is using a tBufferOutput component in child job to buffer the records. tRunJob will read the records from the buffer and transfer them to the next component.
Hope it will be helpful for you!
Best regards
Sabrina
0683p000009MEMg.png 0683p000009MEGA.png 0683p000009MEMl.png 0683p000009MEK8.png 0683p000009MEMq.png 0683p000009MEKg.png
Anonymous
Not applicable
Author

Hi Sabrina,
Thanks again for quick reply.
Can you please share me the bigger images . They are smaller so they are not clearly visible.
anyways Thanks again.


Regards,
Biswajit