[resolved] Sub Job Execution Control with Context Paramter
Hi All,
I've couple of Sub jobs with OnSubJobOk connection in one main job. Now, I want to control the execution of subjobs with parameters like RUN_FROM & RUN_TO which indicates from which subjob to which subjob to run the main job.
Is there any such functionality provided by Talend to control the execution of subjobs ? If not, Any suggestions to implement such kind of functionality ?
Hi Siva,
Please see attached screenshot
1. In main job i had defined two variables as "FROM" and "TO"
2. All subjobs i had connected with mainjob with "Run If" trigger
3. If you connect all subjob with main-job, a order is set on all subjobs
4. checking condition on "Run IF" as
order:1 --> ((Integer)globalMap.get("row5.FROM")) == 1
order:2 --> ((Integer)globalMap.get("row5.FROM")) <= 2 && ((Integer)globalMap.get("row5.TO")) >= 2
order:3 --> ((Integer)globalMap.get("row5.FROM")) <= 3 && ((Integer)globalMap.get("row5.TO")) >= 3
order:4 --> ((Integer)globalMap.get("row5.FROM")) <= 4 && ((Integer)globalMap.get("row5.TO")) >= 4
It works perfectly.
Hi Sabrina,
Thanks for your quick reply.
I looked at the post that you mentioned. In my case, I've OnSubJobOk connection among all the subjobs.
For Eg:
Main job
subjob1 --OnSubjobOK---> subjob2---OnSubjobOk--->subjob3---OnSubjobOk-->subjob4---OnSubjobOk-->subjob5.
I want to control the execution like, I want to start the job from subjob2 and want to stop the job at subjob4 inside main job.
So, Is there any such execution controller ?
Hi Siva, You can use "Run If" instead of onSubjobok and place your RUN_From and RUN_TO condition on every "Run If" trigger It will only control your RUN_TO condition (i.e you can control upto last subjob you want to run) but if your first subjob not satisfied "If" condition then job will not proceed to next subjob. From this way you can only control your last subjob execution. subjob1 --IF---> subjob2---IF--->subjob3---IF-->subjob4---IF-->subjob5
Hi Siva,
I tried and got solution. Try to place your initial job in between and from your main job you connect with your all subjobs using "Run IF" trigger and place "IF "conditions accordingly on trigger.
It will look like this
Hi Manish,
Thanks for your time.
I understand the IF condition solution to set the start point among the sub jobs. I didn't get you in stop point functionality in your implementation among the subjobs. Will you elaborate how your implemention stops the subjobs which are connected by RUN IF or OnSubJobOK.
Does Talend provide any other way of controlling the subjob executions ?
Hi Siva,
Please see attached screenshot
1. In main job i had defined two variables as "FROM" and "TO"
2. All subjobs i had connected with mainjob with "Run If" trigger
3. If you connect all subjob with main-job, a order is set on all subjobs
4. checking condition on "Run IF" as
order:1 --> ((Integer)globalMap.get("row5.FROM")) == 1
order:2 --> ((Integer)globalMap.get("row5.FROM")) <= 2 && ((Integer)globalMap.get("row5.TO")) >= 2
order:3 --> ((Integer)globalMap.get("row5.FROM")) <= 3 && ((Integer)globalMap.get("row5.TO")) >= 3
order:4 --> ((Integer)globalMap.get("row5.FROM")) <= 4 && ((Integer)globalMap.get("row5.TO")) >= 4
It works perfectly.