How to add new workflows to Atoti Limits, covering workflow file creation, process extension configuration, Spring beans for service tasks, YAML for user tasks, and recommended design patterns
A BPMN file is an XML document. Here are recommended steps to create one:
Generate a skeleton using an AI agent
Example prompt:
“Create a BPMN file for a four-eyes breach approval process that automatically sends a
notification after the second approval. Include BPMN diagram tags.”
Use a BPMN editing tool
Tools like bpmn.io help you visualize and edit the BPMN file.
Ensure the process is executable
Include isExecutable="true" in the <process> tag.
Define implementation for service tasks
Each <serviceTask> must include an implementation attribute. The value should match the name
of a Spring bean in your application.
Defining the BPMN file is often the most challenging part. If your workflow becomes hard to
follow, consider simplifying it
using our recommended patterns.
This file tells the Activiti engine how to handle custom elements and attributes not defined in the
BPMN 2.0 schema. In Atoti Limits, it mainly controls which variables are included or excluded
at different workflow stages.
Service task beans must implement the org.activiti.api.process.runtime.connector.Connector
functional interface and be named to match the implementation attribute for the service task in
the BPMN file. For example, if you wanted to treble the value of a numerical variable for the
next step in the workflow, you could do the following:
The Connector beans have access to the Spring context, which means you can inject other Spring
beans into them which can be used for the service task logic.
What if my workflow does not apply to limits or incidents?
If your workflow does not apply to limits or incidents, you can still create the workflow using the
aforementioned approach. You will just need to manually start the workflow and execute the user
tasks throughout the code. This can be done by injecting IWorkflowService and calling: