Automatic BPMN control-flow analysis and resolution

During my PhD research, I implemented a tool for automatic BPMN control-flow analysis to detect deadlocks, starvation, livelocks, and other common modeling errors (the corresponding paper is currently under review).
I was wondering if this is interesting for bpmn.io/camunda. Or are BPMN processes usually linear in practice and do not need such analysis?

The following GIF shows how the tool finds and visualizes starvation in BPMN due to a message not always being sent. It is taken from the paper cited in an issue of the bpmn-js-token-simultion plugin.

ezgif-1-7f21be30f3

You can try the tool yourself here, where you can select different examples in the top right. The tool can even provide quick fixes to a modeler for common errors such as gateway errors (something similar could be implemented for bpmn-lint violations).

The goals of the tool are the following:

  1. Instantaneous analysis (< 500ms).
  2. Understandability
  3. Automatic quick-fixes

My website provides some more details. If you are interested, I can present the tool, how I achieved the three goals, and its potential in more detail.

I am looking forward to hearing your opinion and chatting with you.

@timKraeuter This is a really great project. Processes in the real world are (unfortunately) not linear, hence control flow analysis is an interesting and important aspect to consider.

What I really like about what you shared is that it is such a good E2E user journey. :clap:

Our general take is the following:

  • We try to validate what is edited through pluggable lint rules; this gives users an early warning if they do something wrong, but it requires detection to be fast?
  • We could build such detection as you’ve shown into token simulation; it could in fact be used to visualize (coming from a lint rule) the actual issue at hand for the user :rocket:
  • Mid term (but we’re not there yet): Auto fix (as you showcase)

Would you mind contributing some of the things back that you created? For example, you could create a bpmnlint plug-in or contribute some rules to the core.

I’m CCing @Ingo_Richtsmeier here, could this be interesting for consulting, too?

1 Like

@nikku, thanks for the interest. I would love to contribute things back and see how it can impact modeling in practice.

Currently, I am pretty busy since I am wrapping up my Ph.D. (I plan to finish by 01.10.2024), and I am applying for software engineering jobs simultaneously. However, I am sure we can find a way to integrate features.

I am unsure if this analysis would fit in the context of a lint rule since I am not checking individual elements statically. Instead, I am analyzing the whole diagram dynamically, essentially trying out all possible combinations of BPMN elements (called formal analysis, i.e., model checking in research). Maybe we can discuss the most exciting features for you and how we can best integrate them.

Regarding fast, the analysis is written in Rust for maximum efficiency and speed. It can be run natively as a service or in the browser using webassembly as in the previous link above.
I tested the performance of the native tool in my paper, and in most cases, this led to quite a fast analysis (providing all the details here would be too long). For example, the solutions in the bpmn-for-research camunda repository take 1ms each to analyze (on my machine).

In summary, diagram size itself is not a problem. There are diagrams where the modeler breaks down before the analysis (and vice versa :wink: ). The runtime is mainly affected by diagram complexity, i.e., how many distinct execution paths exist for the given BPMN diagram (parallel branches and multiple pools contribute the most).

Let me know what you think or if you want me to present the tool in detail to you or others.

I am sorry to revive this thread, but luckily, the paper was accepted. A pre-print is accessible here (and the extended version here). It will probably take another month to be officially published.

By the way, I also created a YouTube Demo as part of my paper.
More importantly, how do you think I can best contribute something back?

  • Maybe I can package it as a Camunda modeler plugin?
  • Or do you prefer to extend the lint rules?

I am still writing my PhD thesis, probably until 01.11, but I might get some time and motivation to code here and there.

@timKraeuter I believe packing this up as a bpmnlint extension would be amazing.

This allows folks to consume it, also in the Modeler, through a custom linter rules plug-in.

1 Like

Thanks, for the information. I will try packaging it as a bpmnlint extension when I find some time and keep you updated here.

@nikku I checked the bpmnlint and the custom lint plugins. I can easily write custom rules.
However, I was wondering how to integrate things like the visualization, etc., where I currently just pass modules to the additional modules in the BPMNModeler, see here. I use this to get XML on change (could probably be gotten from the definitions during rule check) but most importantly to interact/change the palette when showing visualizations (based on the bpmn-js-token-simulation) and change the diagram when quick-fixes are applied.
Is this possible through a custom linting rule? Thanks for your help!