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

Control the workflow of a job chain by exit codes

    XMLWordPrintable

    Details

      Description

      Workflow Control
      This feature allows to configure the next job node in a job chain for a range of exit codes of the current job.

      In addition to controlling the workflow by next_state (true) and error_state attributes the exit code of shell processes can be used directly. The return values true and false of API tasks are mapped to the same result as exit code 0 (success) and 1 (error).

      Use Cases

      • If the exit code of the current task returns 3 then the next state for the order should be the error state. Other exit codes are considered to represent the successful execution of the task.
      • If the exit code of the current task returns one of the values 3-9 then the order should be assigned a specific state and should be continued by the respective job node.

      Examples

      <job_chain
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/repository/scheduler/1.9/scheduler.xsd">
          <job_chain_node state="100" job="/test-a"/>
          <job_chain_node state="200" job="/test-a">
              <on_return_codes>
                  <on_return_code return_code="7..9 100..199 -99999..-1000">
                      <to_state state="end"/>
                  </on_return_code>
              </on_return_codes>
          </job_chain_node>
          <job_chain_node state="300" job="/test-a"/>
          <job_chain_node.end state="end"/>
      </job_chain>
      

      Explanations

      • Should the element <to_state> be missing, then JobScheduler will apply the job_chain_node/@next_state or job_chain_node/@error_state attribute.
      • For return_code single values can be specified and closed intervals [i, j] separated by spaces, e.g. "1..5 7 12..15".
      • Each return code can only be used once..
      • The attributes next_state and error_state are applied if no on_return_code element is used.
      • Should no <on_return_code> element match the current return code then JobScheduler will apply the job_chain_node/@next_state (return code 0) or job_chain_node/@error_state (other return codes) attribute.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jz Joacim Zschimmer
                Reporter:
                ss Stefan Sch├Ądlich (Inactive)
                Approver:
                Mahendra Patidar
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 4 days
                  4d
                  Remaining:
                  Remaining Estimate - 4 days
                  4d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified