Adding exception handlers to your flow

When you define a job, job array, flow or subflow, you can specify what exceptions you want IBM Spectrum LSF Process Manager to watch for, and how you want to handle the exceptions if they happen.

About this task

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

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

Procedure

  1. In Flow Editor, select a job or job array, right-click, and select Open Definition.
  2. Select the Exception Handling tab.
  3. Click Add. The Exception Handler Definition dialog is displayed.
  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.

Handling exceptions of a subflow using built-in handlers

Procedure

  1. In Flow Editor, select a subflow, right-click, and select Flow Attributes.
  2. Select the Exception Handling tab.
  3. Click Add. The Exception Handler Definition dialog is displayed.
  4. In the Exception type field, select the exception you want to handle.
  5. 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.

  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 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.

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

Handling 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. Select the arrow to connect the jobs.
  3. Right-click on the dependency line to the recovery job and select Open Definition. The Event Definition dialog box appears.
  4. In the Event Type field, select the appropriate exception.
  5. Click OK.