Defining an error path in a workflow

You can add a branch in your workflow so that if a job goes into error state, the job continues processing in another path in the workflow instead of staying in the Error state. You can define a branch out of any step in the workflow.
To define an error path in a workflow:
  1. Click the Workflow tab.
  2. In the Workflow Objects portlet, click the Workflows tab.
  3. Click the name of the workflow you want to modify.
  4. Disable the workflow.
  5. Optional: Disable the workflow by clicking the switch to the left of the workflow name.
    If you do not disable the workflow while you edit it, jobs that use this workflow continue to move through steps. When you save, the workflow is momentarily disabled then enabled again. Jobs that are processing in the workflow could move into error.
  6. Find the step you want to create an error path for.
  7. Add the step that you want the error branch to take.
  8. Draw a connector from the step where the error could occur to the step that you want to execute when the error happens.
  9. Select the connector you just drew and click Properties (Properties icon).
  10. Right-click the connector you just drew and select Properties.
  11. Add a rule for when the job goes into error:
    1. Type the Rule name to define the new rule.
      We recommend giving the rule a name that identifies the branch as an error path, such as If error. You see the name next to the connector on the Workflow Editor portlet.
    2. To specify the condition to test for the error state, set Property to Current job state, Comparison to =, and Value to Error.

      • Error is the only value for the Current job state property that can be used in a rule.
    3. Make sure that the Order of execution value is set appropriately for the error path. If other conditions are met before the error path, the job might not take the path you intended.
  12. Add a rule for when the job goes into error:
    1. Type the Rule name to define the new rule.
      We recommend giving the rule a name that identifies the branch as an error path, such as If error. You see the name next to the connector on the workflow editor
    2. To specify the condition to test for the error state, set Property to Current job state, Comparison to is (=), and Value to Error.

      • Error is the only value for the Current job state property that can be used in a rule.
    3. Make sure that the Order of execution value is set appropriately for the error path. If other conditions are met before the error path, the job might not take the path you intended.
  13. Add any other conditions that you want to use to evaluate when to take the error path.
  14. Click OK.
  15. Repeat this procedure to add more error paths. Multiple error paths can exist in one workflow.
  16. Save and enable the workflow.
  17. Enable the workflow and test it to make sure that the rules in the branch work in the way you expect. Submit jobs that are sent through all the paths. When a job takes the error path, it moves out of the Error state, so you must find another way to look for jobs instead of searching for the Error state.

    • When the job goes into the Error state, files in the /tmp directory under the spool directory for the job are moved to an /error directory. When they are moved, the step name and phase name are prepended to the file names.
 
Copyright © 2006, 2018