Handling exceptions

About this task

When you define a job, job array, flow or subflow, you can specify what exceptions you want Process Manager to watch for, and how you want to handle the exceptions if they happen. You can specify as many exceptions and handlers as you want for any job, job array, flow or subflow. You can handle an exception automatically using the following:

Procedure

Handle exceptions of a job or job array using built-in handlers

Procedure

  1. Within the flow definition in the Flow Editor, open the job or job array definition.
  2. Click on the Exception Handling tab.
  3. Click Add. The Exception Handler Definition dialog appears.
  4. In the Exception type field, select the exception you want to handle.
  5. If you chose Runs more than..., specify the maximum time, in minutes, the job or job array can run before it should be killed.

    If you chose Runs less than..., specify the minimum time, in minutes, the job or job array can run before it should be rerun.

    If you chose Has exit code, choose the operator and value that best define the exit code requirement. For example, greater than 5.

    If you chose Number of unsuccessful jobs is …choose the operator and value that best define the exit code requirement. For example, greater than 3.

  6. In the Action field, select the appropriate exception handler. In most cases, however, the appropriate exception handler is selected for you, as follows:

    If you monitor for this exception...

    This handler is used...

    Overrun

    Kill

    Underrun

    Rerun

    Exit code

    Rerun

    Number of unsuccessful jobs is …

    Kill


    If you specify a rerun exception, you can specify a number of minutes to delay before rerunning the subflow and the maximum number of times you want the exception handler to rerun the subflow.

  7. Click OK. The exception handling specification is added to the list.
  8. Repeat steps 3 through 7 until you have finished specifying exceptions to handle then click OK.

Handle exceptions of a subflow using built-in handlers

Procedure

  1. Within the flow definition in the Flow Editor, right-click on the subflow.
  2. Select Attributes. The Subflow Attributes dialog appears.
  3. Click on the Exception Handling tab.
  4. Click Add. The Exception Handler Definition dialog appears.
  5. In the Exception type field, select the exception you want to handle.
  6. Select the corresponding criteria for the Exception type that you specified.
    • If you chose Runs more than..., specify the maximum time, in minutes, the subflow can run before it should be killed or should trigger an alarm.

    • If you chose Runs less than..., specify the minimum time, in minutes, the subflow can run before it should be rerun or should trigger an alarm.

    • If you chose the Flow has exit code, choose the operator and value that best defines the exit code requirements before the subflow is rerun or triggers an alarm. For example, greater than 5.

    • If you chose Number of unsuccessful jobs, choose the operator and value that best defines the requirements before the subflow is killed or triggers an alarm. For example, greater than 3.

    • If you chose The work item has an exit code, choose the operator and value that best defines the exit code requirement before the subflow is rerun. For example, greater than 5.

  7. In the Action field, select the appropriate exception handler. In most cases, however, the appropriate exception handler is selected for you, as follows:

    If you monitor for this exception...

    This handler is used...

    Overrun

    Kill or Alarm

    Underrun

    Rerun or Alarm

    Exit code

    Rerun or Alarm

    Number of unsuccessful jobs

    Rerun or Alarm

    The work item has an exit code

    Rerun


    If you choose to rerun the subflow when an exception occurs, you can delay the rerunning of the subflow by a specified number of minutes and specify the maximum number of times you want the exception handler to rerun the subflow, as shown:

  8. Click OK. The exception handling specification is added to the list.
  9. Repeat steps 3 through 6 until you have finished specifying exceptions to handle, then click OK.

Handle exceptions with a recovery job

Procedure

  1. Within the flow definition in the Flow Editor, draw both the predecessor and recovery jobs (or job arrays or subflows).
  2. Change to job dependency mode by clicking the Insert Dependency button.
  3. Draw job dependencies by left-clicking on the job that must run first, then left-clicking on the recovery job.
  4. Right-click on the dependency line and select Open Definition. The Event Definition dialog box appears.
  5. In the Event Type field, select the appropriate exception.
  6. Click OK.

Handle exceptions with a recovery flow

Procedure

  1. In the Flow Editor, define the recovery flow such that it performs the required functions.
  2. When the recovery flow definition is complete, from the Action menu, select Add Flow Attribute...
  3. Click the Triggering Events tab.
  4. Click Add to define an event to trigger this flow. The Trigger Flow with Events dialog box appears.
  5. In the Select type of event field, select Proxy Event.
  6. In the Create Proxy for... field, select Flow.
  7. Optional. In the Owner field, specify the name of the user who owns the flow. If you own the flow, you do not need to specify a name—the user name will default to your own.
  8. In the Flow name field, specify the name of the flow definition whose condition will trigger this flow. Ensure you specify the name of the flow definition, not its file name. The next occurrence of this flow will trigger the flow you are presently creating.
  9. In the Event type field, select the exception condition under which you want this flow to trigger.
  10. In the Description field, add any descriptive text that may be used for understanding this event. For example, if this event requires special instructions for operations staff, place those instructions here.
  11. Click OK. The Flow-Triggering Event(s) dialog reappears, and the proxy event you defined appears in the list.
  12. Click OK. The flow definition is submitted to the Process Manager system, where it will await the appropriate conditions to be run.