Catching errors by using error intermediate events
When you attach it to a service node, the intermediate
event becomes an error boundary event that catches errors and receives
error data from the service to which it is attached. The error boundary
event is triggered while the service is running and interrupts its
execution.
About this task
Shortcut key:
B
In a client-side human diagram, the service node to which the error boundary event can be attached is either a called service or a nested client-side human service.
Tip: To have
different error handling logic for different errors, define multiple
error boundary events on one service node. For each error boundary
event, use different error codes or error data to differentiate between
the different kinds of errors. Then, connect each one to the error
handling logic that applies.
Procedure
To add an error boundary event to a service in a client-side human service:
- Open the client-side human service that you want to work with.
-
In the Diagram view, add an intermediate event
to the service node.
The intermediate event changes into an error boundary eventthat is attached to the boundary of the service.
- Select the error boundary event and, in its Implementation properties, under Event Properties, select Catch all errors or Catch specific errors to specify what type of errors you want the error event to catch.
- If you selected Catch specific errors, click the pickers next to Error code and Error mapping to filter on the error code for the specific errors that can be caught and map the error data to a local variable.
- Connect the error boundary event to the logic you want to run when the error occurs. For example, you can connect it to a coach that displays an error message to a user.
- Click Save or Finish Editing.