Siebel Business Process Framework: Workflow Guide > About Workflow Process Design Options > About Handling Errors >

Using an Error Exception to Handle Errors


An error exception is a type of branch designed for handling system and user-defined errors. An example of a system generated error is a failure when sending an email notification. An example of a user-defined error is attempting to submit an order that is not complete.

You can use an exception branch to programmatically handle errors and change the flow depending on when an error is encountered. This technique provides a granular approach to handling exceptions at each step.

In the Process Designer an Error Exception appears as a red connector between two steps. When you click an exception connector, the Properties window displays the connector's WF Step Branch properties.

When an error occurs, the error code and error message are automatically populated in the Error Code and Error Message process properties. An exception allows you to set up a condition using values in these properties.

Similar to other cases where conditional logic is used in a workflow process, an exception on a step is evaluated after the step has finished. If you need to evaluate an exception before executing a step, you must attach the exception to the prior step in the workflow process.

Example of Error Exception Handling

This topic gives one example of defining error exception handling. You might use this feature differently, depending on your business model.

In the example displayed in Figure 16, when the Get Organization ID step is unable to get data, the workflow continues to the Lookup Sender by Org step. If Lookup Sender by Org fails, the workflow takes the red Exception branch and sends an email using the Send Lookup Error Email step.

Figure 16. Example of a Workflow That Uses Exception Branches to Programmatically Handle Exceptions

Defining an Error Exception

An Error Exception is defined in the Process Designer.

To define an Error Exception

  1. In Siebel Tools, in the Workflow Processes OBLE, right-click the workflow process for which you must define exception handling, then choose Edit Workflow Process.
  2. In the Process Designer, drag then drop an Error Exception connector from the palette to the canvas, attaching one end of the connector to an existing step icon for which you need to trap errors.

    Some example step types you might need to trap for error conditions include the Business Service step type and the Siebel Operation step type.

  3. Make sure the end of the connector is attached to the step.
  4. Drag then drop a Stop step from the palette to the canvas.
  5. Attach the unconnected end of the Error Exception connector to the Stop step.
  6. With the exception arrow chosen in the canvas, enter a value in the Name property in the Properties window.
  7. In the Type property, choose Error Exception or User Defined Exception.
  8. In the canvas, double-click the exception icon to access the Compose Condition Criteria dialog box.
  9. Define conditions that apply for the exception.

    For more information, see Defining Conditional Logic on a Branch Connector.

Defining an Error Exception to Handle an Update Conflict

You can define an error exception to handle an update conflict that occurs when multiple attempts are made to write to the same record at the same time.

When the Workflow Monitor Agent (WMA) is used to invoke a workflow process, which in turn updates a record, the WMA can fail if a workflow process attempts to update a record that is updated by another user or task since it was initially retrieved by the workflow process. In this case, an error message, such as The selected record has been modified by another user since it was retrieved, is displayed. You can prevent the WMA task from failing by defining an error exception to handle an update conflict that occurs while the workflow process is running.

To create a test workflow process that uses an Error Exception to handle an update conflict

  1. In Siebel Tools, create a new workflow process object definition using values described in the following table:
    Property
    Value

    Process Name

    Error Exception Example

    Workflow Mode

    Service Flow

    Business Object

    Opportunity

    To view an example, see Creating a New Workflow Process Object Definition.

  2. Add steps and connectors until your workflow process resembles the workflow illustrated in the following diagram:

    For more information, see About Workflow Process Steps and Connectors, and Diagramming a Workflow Process.

  3. Click the Update Opportunity business service step, then use the Properties window to define properties described in the following table:
    Property
    Value

    Business Service Name

    ABC Update Opty

    Business Service Method

    Update Opty

  4. With the Update Opportunity business service step still chosen, define an input argument in the MVPW using values described in the following table:
    Argument Field
    Value

    Input Argument

    Opportunity Id

    Type

    Process Property

    Property Name

    Object Id

    Property Data Type

    String

    For more information, see About Process Properties.

  5. Define conditional logic on the error exception named Interim Write Error using values described in the following table:
    Property
    Value

    Compare to

    Process Property

    Operation

    One Must Match (Ignore Case)

    Object

    Error Code

    Values

    0x8137 -- 0x6f74

    Note that 0x8137 -- 0x6f74 is the error code returned with the The selected record has been modified by another user since it was retrieved error message.

    For more information, see Defining Conditional Logic on a Branch Connector.

  6. Define the Update Opportunity Again business service, using the same values you used in Step 3 and Step 4. For the Name property, use Update Opportunity Again.
  7. Validate then simulate the workflow process.

    For more information, see Process of Testing a Workflow Process.

  8. Implement this technique in your production workflow.
How This Example Works

The Update Opportunity Again step provides a way to write to the opportunity record again in cases where the first attempt to update an opportunity fails due to the update conflict error. Note that this example uses a Business Service step that updates opportunity records. The same technique can be used with other step types that update a record, such as a Siebel Operation or a Sub Process step, and with other types of records, such as accounts or contacts.

Siebel Business Process Framework: Workflow Guide Copyright © 2008, Oracle. All rights reserved.