This article includes updates for Smart ID 23.10.3.
This article describes service tasks that can be used in Smart ID Identity Manager to provide improved error handling in the BPMN processes. The tasks compensate a problem that occurs when a task inside a process fails and thus causes the complete process to fail. To provide reliable processes it is often necessary to react on failures during process execution with a defined behavior, so that the process can provide it's own error handling. The error handling service tasks provide a simple way to catch every kind of failure and wrap it inside a BpmnError
that can be processed by the process.
The project utils provide tasks for different kinds of standard JavaDelegate classes. They all have the same behavior, that is, to invoke a BPMNError if the inner delegation class fails. The tasks can be used in service tasks in BPMN processes by setting the bean name as delegate expression.
Since not all of these tasks are available in the default Identity Manager installation, you have to follow these steps:
- Activate the service tasks by adding their bean definitions to custom-beans.xml.
- Restart Tomcat so that the new bean definition will be loaded by Identity Manager.
- In the service task, set the delegate expression with Identity Manager Admin, after you have uploaded the processes, or edit the delegate expression directly in the BPMN definition with Nexus Activiti Designer. See Set up process in Identity Manager.
Be careful with exceptions! Even if Identity Manager catches the exceptions, Activiti will still try to roll back the process. To avoid this, the part that might throw the exception must be executed asynchronously by setting the attribute async=true
in the BPMN definition.