Using System Exceptions Oracle Fusion Middleware Online Documentation Library

19-8 Modeling and Implementation Guide for Oracle Business Process Management For information on how to configure the implementation properties to catch business exceptions, see Section 19.5.5, How to Configure an Error Event to Catch Business Exceptions . For information on how to configure the implementation properties to catch system exceptions, see Section 19.5.6, How to Configure a Catch Event to Catch System Exceptions .

19.5.4 What Happens When You Handle an Exception Using an Event Subprocess

If the exception handled in the event subprocess occurs while running any of the tasks in the process, then the BPMN Service Engine continues running the exception handling flow defined in the event subprocess.

19.5.5 How to Configure an Error Event to Catch Business Exceptions

You can configure an error event to catch business exceptions. To configure an error event to catch business exceptions you must edit the error event implementation properties. To configure the implementation properties of an error event to catch business exceptions: 1. If you want to handle all the business exceptions that can occur while running this process, then select Catch All Business Exceptions. If you want to catch a specific business exception:

a. Click the Browse button next to the Exception field.

The Type dialog box appears. b. Enter the name of the exception or select it from the tree.

c. Click OK.

The Type dialog box closes and the selected exception appears in the Exception field.

19.5.6 How to Configure a Catch Event to Catch System Exceptions

You can configure an error event to catch system exceptions. To configure an error event to catch system exceptions you must edit the error event implementation properties. To configure the implementation properties of an error event to catch system exceptions: 1. If you want to handle all the system exceptions that can occur while running this process, then select Catch All System Exceptions. If you want to catch a specific business exception:

a. Click the Browse button next to the Exception field.

The Type dialog box appears.

b. Select Show System Faults.

The tree shows the available system faults. For a list of the supported exception for the different error events, see Table 19–1 . c. Enter the name of the exception or select it from the tree. Handling Errors 19-9

d. Click OK.

The Type dialog box closes and the selected exception appears in the Exception field.

19.6 Throwing Exceptions in Subprocesses or Reusable Processes

You can only throw business exceptions using an error end event, thus only parent processes can catch these exceptions. You can configure your process to throw custom high level exceptions instead of throwing the low-level exceptions that occur while running the task. To throw a high level exception, connect the boundary events in your activities to the end event that throws the error, or finish the subprocess event with an error end event.

19.6.1 How to Throw an Exception

You can use an error end event to configure your BPMN process to throw a business exception. To throw an exception: 1. If you want to throw a custom exception, create a business exception. You can also throw existing business exceptions or system exceptions. See Section 19.6.3, How to Create a Business Exception for more information on how to create a business exception. 2. Identify the point in your process where you want to throw the exception. 3. Branch the flow of the process using one of these options: ■ Add a gateway to create a branch in the flow of the process. ■ Add a boundary event.

4. From the Component Palette, drag Error End Event and drop it in the process.

5. Add a sequence flow to link the gateway or boundary event, and the error end event. 6. Right-click the error end event.

7. Select Properties.

8. Click the Implementation tab.

9. Click the Browse button next to the Exception field.

The Type dialog box appears.

10. If you want to throw a system exception, Select Show System Faults.

The tree shows the available system faults. For a list of the supported exception for the different error events, see Table 19–1 . 11. Enter the name of the exception or select it from the tree

12. Click OK.

The Type dialog box closes and the selected exception appears in the Exception field.

13. Click OK.