Handling errors in processes
A process contains a sequence of steps that flows from the start event to the end event. Occasionally, these steps can generate errors or exceptions. In BMC Digital Workplace Catalog, a catalog administrator can use the error events in the workflow designer to capture errors and exceptions and to display appropriate messages.
Error events overview
The workflow designer includes the following error events:
An Error Boundary event captures business errors and exceptions within a process and identifies the process path to be followed to resolve the error.
A work order is not completed within two business days. This business error is captured by the system, and a notification is sent to the manager of a department.
An Error End event ends up execution of a process at the current path, and an error is thrown. As a result, the service request is closed with a description of an error that occurred in the process.
A work order is not completed within two business days. This business error is captured by the system, and the service request is closed with the details about the error.
Before you begin
Capture of errors and exceptions with the Error Boundary event
An Error Boundary event is always placed on the boundary of any of the following workflow elements:
Activities: Receive Task, Call Activity, Sub-Process
Error Boundary events added on the boundary of a Sub-Process element catch all errors and exceptions generated from the child processes.
- Actions of any connector
Other elements of the workflow designer: Build Input Set, Create Approval Stub Entry, Send In App Notification, Set Service Request Status, Track External Activity.
The Error Boundary event captures the following errors and exceptions:
Business errors are the logical errors occurring within a process that cause the process to operate incorrectly or produce incorrect results. For example, assigning a value to the wrong variable produces incorrect result.
Business errors are captured only for Call Activity and Sub-Process elements, and are displayed using the Error End event in a process or sub process.
You can select to catch all business errors or specific business errors.
Instances of different Java exceptions might be generated during a process run time. For example, if your workflow includes a Create Incident action and a system is down at the time of the process execution, an exception is generated.
You can select to catch all Java exceptions or specific Java exceptions. To capture a specific exception, you must enter a fully qualified name of an exception.
You can add multiple Error Boundary events to an activity or an action.
If you configure an activity with multiple Error Boundary events, the Error Boundary event configured for capturing specific errors and exceptions takes precedence over the Error Boundary event configured for capturing business generic errors and exceptions.
To add an Error Boundary event in a process
Log in to BMC Digital Workplace Catalog as a catalog administrator.
Open a workflow in which you want to add the Error Boundary event.
- Add the Error Boundary event to the process.
- On the canvas, drag and drop an Error Boundary event on the boundary of an activity elements, either, a Call Activity element or a Sub-Process element, as required.
- In the Properties pane, enter the description and select Add/Remove Errors.
The Add/Remove Errors UI allows you to capture the errors and exceptions based on the following options:
- All Business Errors—To capture all the errors from Call Activity or Sub-Process elements.
- Specific Business Error—To capture those errors that are from only Call Activity or Sub-Process elements defined for the task.
- All Exceptions—To capture all Java exceptions generated by the process.
- Specific Exceptions—To capture only specifically identified exceptions.
- Click Save.
To display errors using the Error End event
An Error End event indicates a business error in a process. This business error is captured by the relevant Error Boundary event. If no Error Boundary event is found to capture a business error, the error is displayed to the end user.
An error message is defined for a business error. The error message is an expression which refers to context data, such as a process variable, a result of an activity, or a keyword. The expression in the error message is evaluated when the process generates a business error.
- Log in to BMC Digital Workplace Catalog as a catalog administrator.
- Open a workflow in which you want to add the Error End event.
- Add the Error End event to the process.
- On the canvas, drag and drop an Error End event.
- In the Properties pane, type a label and a description.
- From INPUT MAP, select Click to build an expression.
Click to build an expression allows you to create an expression for an error message that is displayed at runtime.
- Click Save.
Where to go from here
Complete remaining aspects of the workflow, as described in Workflows for service fulfillment.