Client-side human services: Catching errors by using error event handlers

Use error event handlers to catch errors at any point in a client-side human service and to implement error handling logic for these errors. To catch a specific error, you can set the properties of the error in the Implementation tab of the error event handler by specifying the error code and mapping the error data to a specified variable.

About this task

Procedure

To add an error event handler to the client-side human service, complete the following steps:

  1. Open the Process Designer desktop editor.
  2. Open the client-side human service that you want to work with.
  3. In the Diagram view, drag an event handler Event handler tool onto the canvas. By default, an event trigger of error event is assigned and the handler changes to an Error event handler. Event handler
  4. By default, the error event is set to catch all errors. To catch a specific error, complete the following steps:
    1. In the Implementation tab, under Behavior, select Catch specific errors.
    2. Click Error code picker to select a local variable that specifies the error code for the error to be caught.
    3. Click the Error mapping picker to map the error data to an error mapping variable that was previously defined on the Variables tab.
  5. Double-click the error event handler, and then implement your error handling logic.
    • You can declare additional private variables in the error event handler that are visible only to the event handler.
    • You can use a coach to display the error to the user.
      Important: If you use a coach in the error event handler, you must provide a path that exits the flow with either an end event or an error end event. If you use a stay-on-page event after a coach in an error event handler, you will be returned to the coach you just exited. If there is no other path out of the coach, an infinite loop occurs.
    An example of an event handler error implementation. The diagram shows a flow that consists of a start event that is connected to a script, which is connected to a stay on page event.
  6. Optional: To define multiple error event handlers that can have different error handling logic for different errors, iterate through steps 3 - 5. For each error event handler, use different error codes or error data to differentiate between the different kinds of errors.
  7. Click Save all to save the configuration of the client-side human service.