...
The Join Job can only be used within a Job Chain and is only available for JobScheduler versions 1.11.4 and newer, See the How To Synchronize Job Execution Across Job Chains article for information about synchronizing Jobs in different Job Chains and for joining up parallel executing child Job Chain segments in JobScheduler versions 1.11.3 and older.
Job Chain Patterns
split and join Pattern
The configuration of the Join Job for the split and join pattern is described in the How to Execute Jobs in a Job Chain in Parallel article.
Relevant for the current article is that while the Join job is used without any parameters being configured, the Split Job generates a parameter - required_orders
- which is forwarded to the Join Job.
sync_state_name
:- This parameter is required for the Job Chain Details view in the JOC Cockpit and for the Job Chain Diagram shown in JOE. It accepts the value of the state that is associated with the
join
Job node.
- This parameter is required for the Job Chain Details view in the JOC Cockpit and for the Job Chain Diagram shown in JOE. It accepts the value of the state that is associated with the
'Y' Pattern
The ....
Flowchart |
---|
test [label="Order:test",fillcolor="green"]
100 [label="100",fillcolor="lightskyblue"]
reset [label="Order:reset",fillcolor="green"]
wait [label="wait",fillcolor="lightskyblue"]
150 [label="150",fillcolor="lightskyblue"]
join [label="join",fillcolor="lightskyblue"]
200 [label="200",fillcolor="lightskyblue"]
success [label="success",fillcolor="orange"]
test -> 100
100 -> wait
reset -> join
wait -> join
150 -> join
join -> 200
200 -> success
|
The...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
<job order="yes" stop_on_error="no">
<script language="java:javascript">
<![CDATA[
function spooler_process(){
var jobChain = spooler.job_chain('/join/job_chain_test');
for (i=0;i<10;i++){
var order = spooler.create_order();
order.id = spooler_task.order.id + "_" + i;
order.params.merge(spooler_task.order.params);
order.end_state="join";
order.state="150";
jobChain.add_order(order);
}
return true;
}
]]>
</script>
<run_time />
</job> |
The test Order starts the first Job (job_create_orders) in the job_chain_test Job Chain:
- this Job contains a shell script that generates 10 orders (see line XX of the listing) for the branch of the Job Chain from the job_nix Job to the join Job.
- As the end_state for the generated Orders is the join Job state, these orders will be registered by the join job and counted towards to the value set by the job_create_orders shell script in the
.....