Support multi-diagram

Our company is committed to model executable business processes using BPMN. As soon as processes become complex Camunda Modeler shows its limitations especially managing subprocesses, call activities and in general structured processes suited to be modeled with multi diagram BPMNs.

According to BPMN 2.0 specifications, it’s possible to define multiple bpmndi:BPMNDiagram tags in a single BPMN file. So we started forking bpmn-js source code and modifying it to add this feature, coming up with this modeler example demo which adds diagram controls to the canvas, as shown below.

modeler_screencast

After that, we edited camunda modeler source code, to add multi-diagram controls to it and we created one plugin which makes use of this feature in this example scenario. Suppose, as described in this topic, that you want to get a number in input and dinamically create the specified number of subprocesses.
The solution described in that topic is to create two partecipants in a collaboration and, with a call activity from the first one, call the second partecipant.

With this feature, instead, the collaboration is not needed anymore. We can define the two processes in two different diagrams of the same bpmn file, defining the call activity to call the second process in the bpmn file and, as additional feature, we can directly double click on the call activity to see the linked process!

plugin_screencast

We already made a pull request for the bpmn-js part and we are waiting for it to be integrated to open the pull request for Camunda modeler.

What do you think about it? We’d really appreciate your opinion, feel free to support and collaborate with us!

2 Likes

This is pretty awesome! We will look into the PR and discuss it internally. Stay tuned.

2 Likes

Hi @philippfromme, thank you :slight_smile:
Are there any news about this feature? Is there something I can do to help you?
I thought also, if someone wants to check it out, to write some instructions to make it work.

You need to check out also our latest bpmn-js branch version and link it to modeler. That’s why we are waiting for bpmn-js integration to create modeler pull request.
Follow this steps:

  • clone our bpmn-js repository from here, and checkout branch feature/multipleDiagram
  • npm install
  • npm link
  • go to our cloned modeler version
  • npm install
  • npm link bpmn-js
  • npm run dev

In this way, you linked the ‘compiled’ bpmn-js module to modeler.

Hi @daimadoshi85 I am currently getting familiar with the plugin and I have a question - is it intentional that the plugin doesnt work with diagrams, containing pools? I using Camunda 5.3 and so far the plugin only works if I create very simple processes. Thank you in advance!

Hello @deadlyracoon ! Yes, it is, in fact.
While I was developing the new version for Camunda Modeler 5, I found a few bugs and inconsistencies making a collaboration with multi processes. If, in the future releases, I will solve these inconsistencies, I will probably remove this condition.
Feel free to write an issue on github for it and contribute :wink:

1 Like

Thank you for your reply! I will open an issue and am willing to work on it. Could you let me know where this condition is implemented and where I should focus on?

Hey! Sorry for the late reply!
I am pretty sure the problem is partly in DiagramUtil.js, where you need to handle correctly the diagrams inside the collaboration AND the diagram(s) of the global process(es), and the relative root elements.
The other files involved are in client/react directory.

Maybe I will work on it in these days, but I am not sure.
Please let me know if you fork the project and start working on it!

Hey @daimadoshi85, you mention that “According to BPMN 2.0 specifications, it’s possible to define multiple bpmndi:BPMNDiagram tags in a single BPMN file.”, but I couldnt find anything on multidiagrams in the specs. Can you please refer me to where it is mentioned in the specs? Thank you a lot.

Hi @octopi8
If you check bpmn2.0 xsd, there are no restrictions about it. The multi-diagram plugin simply defines multiple global processes in the same bpmn file, that you can invoke using a Call activity, as described in BPMN 2.0 Chapter 10.4.2