
Intermediate event - error event (interrupting)

Key Characteristics
-
Boundary of an Activity node or Subprocess:
- Error Events can only be used on the boundary of an activity, including subprocesses nodes. They cannot be placed in the normal flow of the process.
-
Always Interrupt the Activity:
- Itβs important to note that Error Events always interrupt the activity to which they are attached. There is no non-interrupting version of Error Events.
-
Handling Thrown Errors:
- A thrown error, represented by an Error Event, can be caught by an Error Catch Event. This is achieved specifically using an Error Boundary Event, which is placed on the boundary of the corresponding activity.
-
Using error events on Subprocesses nodes:
- An error catch event can be linked to a subprocess, with the error source residing within the subprocess itself, denoted by the presence of an error end event, signifying an abnormal termination of the subprocess.
Configuring an Error Intermediate boundary event

- Name: Assign a name to the event for easy identification.
- Condition: Specify the condition that triggers the error event. Various script languages can be used for defining conditions, including:
- MVEL
- JavaScript
- Python
- Groovy
To draw a sequence from an error event node and link it to other nodes, simply follow these steps: right-click on the node, and then select the option to βAdd Sequence.β
When crafting a condition, use a predefined key as illustrated below:
For instance, in the example provided, weβve taken a process key defined on a switch UI element and constructed a user-defined condition like this:

input.application.switch == true
.- Priority: Determine the priority level of this error event in relation to other error events added on the same node.
-
input.application.switch
: This represents a key to bind a value to the Switch UI element within the βapplicationβ part of the βinputβ. It is used in this example to capture input or configuration from a user. -
==
: This is an equality operator, and it checks if the value on the left is equal to the value on the right. -
true
is a boolean value, which typically represents a state of βtrueβ or βon.β
Use Case: Handling Errors during User Task Execution
Description: This use case pertains to a page dedicated to collecting client contact data. Specifically, it deals with scenarios where users are given the opportunity to verify their email addresses and phone numbers.In this scenario we will create a process to throw an error if an email address is not valid.

Example configuration:
- Error Boundary Event: We will set an error boundary event associated with a user task.
- Error Node: The node will be responsible to redirect the user to other flows after the userβs email address is validated based on the conditions defined.
The expression checks if the email address configured in 
application.client.contactData.email.emailAddress
key is not equal to βjohn.doe@email.com.β If they are not the same, it evaluates to true, indicating a mismatch.
- Flow Control: Depending on the outcome of the validation process, users will be directed to different flows, which may involve displaying error modals as appropriate.
