Uploaded image for project: 'JS - JobScheduler'
  1. JS - JobScheduler
  2. JS-1193

Start of an order should be possible depending on the result of a task of a job chain node





      • A Plugin is provided that handles the return code of a previous job node:
        <NodeOrderPlugin:add_order NodeOrderPlugin:job_chain="/test-b"/>
      • The following modes are available for the handling of the Order ID when adding orders:
        • If no Order ID is specified then the order receives the Order ID of the current order. A different job chain has to be specified and that job chain must not contain an order with same Order ID.
        • The order is assigned an individual Order ID and job chain (which includes assigning the current job chain). The Order ID of the current order can be referenced by using the variable ${ORDER_ID}.
        • Examples
          • <add_order job_chain="..."/> adds an order with the same Order ID as the current order to a different job chain.
          • <add_order id=“${ORDER_ID}.1” job_chain="..."/> adds an order with parts of the Order ID being created from a reference to the Order ID of the current order. The current job chain or a different job chain can be used.
      • The handling of parameters is applied as follows:
        • A newly added order receives a copy of the parameters of the current order.
        • Additional parameters can be added by using the elements <add_order><params><param name="..." value="..."/>.... Additional parameters have precedence to parameters of the current order.
      • Any errors when adding the order to the job chain are logged and ignored.

      Following configuration has to be applied to scheduler.xml to enable the corresponding plugin:

      <?xml version="1.0" encoding="utf-8"?>
      <spooler xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/repository/scheduler/1.7/scheduler.xsd">
                  <plugin java_class="com.sos.scheduler.engine.plugins.nodeorder.NodeOrderPlugin"/>

      Complete sample job chain

      <?xml version="1.0" encoding="utf-8"?>
              xsi:schemaLocation="https://jobscheduler-plugins.sos-berlin.com/NodeOrderPlugin NodeOrderPlugin.xsd"
          <job_chain_node state="200" job="/test-exit-7">
                  <on_return_code return_code="7">
                      <NodeOrderPlugin:add_order NodeOrderPlugin:job_chain="test-a"/>
                  <on_return_code return_code="5">
                      <NodeOrderPlugin:add_order NodeOrderPlugin:job_chain="./test-b"/>
                      <NodeOrderPlugin:add_order NodeOrderPlugin:job_chain="/other-folder/test-c" NodeOrderPlugin:id="${ORDER_ID\u0022}-copy"/>
                  <on_return_code return_code="9">
                      <add_order xmlns="https://jobscheduler-plugins.sos-berlin.com/NodeOrderPlugin" job_chain="/x">
                              <param name="a" value="AAA"/>
                              <param name="b" value="BBB"/>
                      <to_state state="end"/>
          <job_chain_node.end state="end"/>


      • The NodeOrderPlugin allows to specify absolute and relative paths for job chains. Relative paths are based on the location of the current job chain.
      • Multiple orders (in different job chains) can be started for the same return code.
      • The job chain path of the new order can be used relative to the current job chain. Just let the path start with "./".
      • Mixed usage for orders that should be added and for the job node state that an order should move to is possible.

      To use the plugin, it has to be included in the JobScheduler configuration file scheduler.xml:

      <?xml version="1.0" encoding="utf-8"?>
      <spooler xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://www.sos-berlin.com/repository/scheduler/1.9/scheduler.xsd">
                  <plugin java_class="com.sos.scheduler.engine.plugins.nodeorder.NodeOrderPlugin"/>


      • As of now JobScheduler release 1.9.RC1 there is a restriction on target job chain configuration.
      • If a target job chain is present in same folder where job chain configured to send order is present, target job chain can not be referred directly.
      • Which means target job chain can only be referred with a relative or absolute path.
      • Please see the example of restriction;
        <add_order xmlns="https://jobscheduler-plugins.sos-berlin.com/NodeOrderPlugin" 
      • Above mentioned configuration of target job chain will not work.


        1. JOC-error-JS1193.png
          165 kB
        2. RELEASE-TEST-1.9.zip
          10 kB
        3. RELEASE-TEST-1.9.zip
          10 kB
        4. scheduler-djmp-snapshot-1.9.log.zip
          141 kB

        Issue Links



              mp Mahendra Patidar
              ss Stefan Schädlich (Inactive)
              Mahendra Patidar Mahendra Patidar
              0 Vote for this issue
              7 Start watching this issue



                Time Tracking

                  Original Estimate - 4 days
                  Remaining Estimate - 4 days
                  Time Spent - Not Specified
                  Not Specified