Handle Errors with Event Subprocesses
Use event subprocesses to handle exceptions that occur in the runtime life cycle of a process and cause it to fail.
Using an event subprocess activity, you can catch all or specific system exceptions and recover the original process flow or supply an alternative, exception-handling flow.
You can define more than one event subprocess to handle different exceptions within a single process.
- It is not possible to define multiple event subprocesses catching the same error in the same scope.
- It is not possible to have more than one event subprocesses catching all errors in the same scope.
- Subprocesses can have their own event subprocesses to handle errors. An error that occurs in the subprocess can be caught by the subprocess level event subprocess instead of the process level subprocess.
In the example below, an event subprocess Handle Payment Failure
is used to handle any payment failure errors in the main process. When an error occurs in the Make Payment
service task, it gets canceled and the Handle Payment Failure
event subprocess is triggered. The process then continues to run in the event subprocess flow and completes.
Description of the illustration event-subprocess-example.png
Add an Event Subprocess
- In the Activities palette, expand Systems.
- Drag the Event Subprocess activity onto the process editor canvas, and drop it at the required position. Note that you should add the activity outside your process flow as event subprocesses don’t support incoming or outgoing flows.
-
Expand the event subprocess activity. You’ll see a default error-handling flow with a Start Error event and an End event. You can add other activities, such as human tasks, to the flow according to your requirements.
You cannot configure properties or define data association for the event subprocess activity as a whole; however, you can configure the Start Error event to catch and handle exceptions.
Configure a Start Error Event
In order to give users data to analyze the error, some data objects such as error code, error payload, uri and error name are provided out of the box in the data association editor of the Start Error event activity. In runtime, users are able to analyze the cause of the error with this information.