Typical Flow of an Exception in a Reusable Process

Handling Errors 19-11

19.7 Handling Exceptions in Subprocesses

You can handle exceptions that occur in a subprocess in the same way you handle the exceptions in any other BPMN activity.

19.8 Handling Errors in a Peer Process Using Message Events

When a process communicates with another peer process, running any of the flow objects in the peer process may result in an error. For synchronic operations, the correct form of propagating these errors to the invoking peer process is using message events configured as errors. A message event configured as an error communicates to the invoking peer process that an error occurred while running the process. However the audit trail indicates that the process ran successfully because this is an expected error. You must define how the invoking peer process handles the exception using one of these options: ■ Add a boundary error catch event to the flow object that invokes the peer process. ■ Add an event subprocess that handles the exception to the invoking peer process. If you do not handle the error in the invoking peer process, the error propagates and the process running does not complete successfully. Difference Between Using Error Events and Error Message Events Using error end or throw events to handle errors during interprocess communication is not a good practice. You must only use error events for internal errors that might be handled within the process or propagated to the next level. These errors are not meaningful outside of this process. The exceptions occurred while running a peer process do not propagate to the invoking peer process. Eventually the invoking peer process receives a time out notification because the peer process stopped responding.

19.8.1 How to Handle Errors in a Peer Process Using Message Events

If you know running an operation in a process that is used for inter-process communication may result in an error, it is advisable to add a message end or throw event to propagate the error to the invoking peer process. The message error implementation requires you to select a business exception. If your project does not define business exceptions, then you must create a business exception. For more information about business exceptions, see Section 19.2, Using Business Exceptions . To handle errors in a peer process using message events: 1. Edit the peer BPMN process.

2. Add a message end or throw event.

3. Add a sequence flow from the flow object that can produce an error to the message

end event. Note: You must always define a path for the instance to follow if there are no error. If you do not define a path for the case where there are no errors the project does not build successfully.