running job multiple times

One Star

running job multiple times

Hi,
I have a requirement where I need to run sub job job multiple times based on the value of a count. Say, if count is 4 then the subjob should run 4 times.
Is there any ways to run same sub job multiple times ?

Thanks and Regards,
Biswajit
One Star

Re: running job multiple times

Hi,
I simulate a job like
rowGenerator--Main-->JavaRow--OnComponentOk-->Loop--Iterate-->Runjob
In rowGenerator,I just set a int number "count" by random.
In JavaRow, I wrote code :globalMap.put("count", input_row.count).
In loop, I set ((Integer)globalMap.get("count")) for Max.
In Subjob, I just put a tsystem .
And this work fine.
Best regards
One Star

Re: running job multiple times

Hi ,
Thanks for the reply.It works.
Can you please tell me how I an pass different values using this. Say in TrunJob I need to pass different numeric value to tRunJOb on each loop. Is it possible to do that?

Thanks and Regards,
Biswajit
One Star

Re: running job multiple times

Hi,
Base on the first simulation,
I modify a job like.
Loop--Iterate-->rowGenerator--Main-->JavaRow--OnComponentOk-->Loop--Iterate-->Runjob
|
OnComponentOk
|
v
tSetEvn
In first loop: I set defaut.I just want to simulate that job runs.
In tSetEvn: I set Name: "count" and Value: (""+globalMap.get("count"))
In subjob , I still use tsystem,but with a new code: "cmd /c echo HELLO "+System.getProperty("count").
So, you can see that this job run several time and with different values.
I hope its useful
Best regards

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