Handling errors in client-side human services
To catch errors in client-side human services, you can use intermediate events that can be attached to service nodes.
About this task
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.
Tip: If you want
to have different error handling logic for different errors, define
multiple error boundary events on the single 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.
Icon | Error event | Description |
---|---|---|
Error boundary event that is attached to a service node in a client-side human service | Catches errors and receives error data from the service to which it is attached. |
When you plan to use error events in your client-side
human service, consider the following points:
- You can attach error boundary events only to service nodes in your client-side human service.
- You can reposition an error boundary event inside the service, you can remove it from the service, or you can move it to another service. In client-side human services, the error boundary event cannot exist as a stand-alone error event outside of a service node.
- Consider specifying the error properties to catch specific errors,
filtering on the error code for the types of errors that are caught,
and mapping to a variable after the errors are caught.
- The error event information is captured in the tw.error.code and tw.error.data variables.
- By mapping the error boundary event to a variable, events with incompatible data types are filtered out and the data is captured in a local variable.
Procedure
To add an error boundary event to a service in a client-side human service:
- Open the Process Designer desktop editor.
- Open the client-side human service that you want to work with.
- In the Diagram view, drag the Intermediate event tool and drop it onto the service node that you want to attach it to. The intermediate event changes into an error boundary event that is attached to the boundary of the service.
- Select the error boundary event and, in its Implementation tab, 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 all to save the configuration.