Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When you want to let an order wait until an order in another job chain has passed successfully a specific node, you can use the sync job. Here are some use cases:1.

  1. two or more job chains. One order in every job chain. The order can proceed, when they are all on a specific node in their chain.

...

  1. Like 1. but now, you want to wait for more than one order.

...

  1. You have job chains A,B,C. C can start, when A or B are finished.

1.two or more job chains. One order in every job chain. The order can proceed, when they are all on a specific node in their chain.

...

  1. create a node before the node, you want to wait. Assign the just created job to this node
  2. create a node after the node, you want to wait for. Assign the just created job to this node
Code Block

 <?xml

...

 version="1.0" encoding="ISO-8859-1"?>
Code Block
 <job_chain>
    <job_chain_node state="100"
                    job="jobsSample_1"
                    next_state="sync"
                    error_state="error"/>
    <job_chain_node state="sync"
                    job="Sync"
                    next_state="200"
                    error_state="error"/>
    <job_chain_node state="200"
                    job="jobsSample_3"
                    next_state="success"/>
    <job_chain_node state="success"/>
    <job_chain_node state="error"/>
 </job_chain>
Code Block
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <job_chain>
    <job_chain_node state="100"
                    job="jobsSample_2"
                    next_state="sync"
                    error_state="error"/>
    <job_chain_node state="sync"
                    job="Sync"
                    next_state="success"
                    error_state="error"/>
    <job_chain_node state="success"/>
    <job_chain_node state="error"/>
 </job_chain>

2.Like 1. but now, you want to wait for more than one order.

  1. Same steps as at 1.
  2. You can specify for each job chain, how many orders have to be at the sync point to set the node to GO. Note: If you want to specify it for different nodes, you can use parameter job_chain;state_required_orders

...

Code Block
 <job title="Synchronize Job Chains"
     order="yes">
    <params>
        <param name="job_chain1_required_orders" value="3"/>
        <param name="job_chain2_required_orders" value="1"/>
    </params>
    <script language="java"
            java_class="sos.scheduler.job.JobSchedulerSynchronizeJobChains"/>
 </job>

3.You have job chains A,B,C. C can start, when A or B are finished.
specify parameter minimumSyncHits=1.

...