Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have 2 child jobs( child job 1 and child job 2) and 1 parent job. In parent job, I need to give a condition based on which child job 1 or child job 2 or both the child jobs should get executed.
For Example: If value is "Y" in parent job, then child job 1 should get executed. If value is "N" then child job 2 should get executed. Else, both the child jobs should get executed.
Can you let me know how to achieve this?
Thanks
Define a context variable to store the value, and use RunIf connector to control the child jobs execution..
on tJava--runIf11--tRunJob1
--runIf2--tRunJob2
--runIf3--tRunJob1--oncomponentok--tRunJob2
set the condition of runIf1 as:
context.varName.equals("Y")
set the condition of runIf2 as:
context.varName.equals("N")
set the condition of runIf3 as:
!(context.varName.equals("Y")||context.varName.equals("N"))
on tJava or other components, initialize the value of the context variable or load the value from somewhere.
Regards
Shong
Define a context variable to store the value, and use RunIf connector to control the child jobs execution..
on tJava--runIf11--tRunJob1
--runIf2--tRunJob2
--runIf3--tRunJob1--oncomponentok--tRunJob2
set the condition of runIf1 as:
context.varName.equals("Y")
set the condition of runIf2 as:
context.varName.equals("N")
set the condition of runIf3 as:
!(context.varName.equals("Y")||context.varName.equals("N"))
on tJava or other components, initialize the value of the context variable or load the value from somewhere.
Regards
Shong
Thanks for the solution
Hi @Shicong Hong ,
I have a situation now where I don't want to create third flow i.e, I don't want to repeat tRunJob1 and tRunJob2 in the third flow as I have already created 2 separate flows for that.
If I give the value as "Y" then first flow should execute. If I give the value as "N" then second flow should execute. And, both the flows should execute in sequence based on some condition.
Can you suggest if this is possible to do and what should that condition be and how we can set up that condition?
One component can has only one runIf connector to the same target component, so you can use three tJava components in this case, for example:
tJava1--oncomponentok--tJava2--runIf1--tRunJob1
|oncomponemntok **************--runIf2--tRunJob2
tJava3
--runIf3--linked to the same tRunJob1
--runIf4--linked to the same tRunJob2
set the same condition on runIf3 and runIf4, so that tRunJob1 and tRunJob2 will be both executed if the condition is met.