Layouting Message Flows in the Camunda Modeler (BPMN editor)
Its pretty easy to create process models in the modelling notation BPMN by using the camunda modeler which is a plug-in for Eclipse. However, message flows which join pools are a bit cumbersome (still applies to the current version 2.6.0). Per default the message flows always start in the center of the source element and end in the center of destination element. The process models are therefore hard to read due to overlapping message flows:
In many cases the message flows would actually look much better if they were layouted vertically with a single line, but this is difficult (impossible?) to achieve with the graphical interface of the camunda modeler. (The Signavio modeler actually draws good looking vertical lines!)
BPMNs are serialized using a XML format specified by the OMG (BPMN 2.0 Spec). A possible solution is to edit the underlying XML format manually in the “Source” view of the camunda modeler. The message flow is per default defined by four points of which the second and the third points must be removed and the horizontal ordinate of the start or end point must be updated (which one depends on the message flow’s direction).
Preferably, the manipulation of the XML should be automaticaly repeatable, e.g. using XSLT. The following XSL transformation does the job:
In this example the source and destination files are identical, i.e. the source file will be overwritten by the result of the transformation.
The resulting process model is much easier to read:
Note: Outgoing and incoming message flows of tasks are placed slightly to the left and right, respectively.
Invocation in Eclipse
It’s a waste of time to call xsltproc in the command line and get the parameters correct on every invocation. A simple but time saving solution is to configure an “External Tool” configuration in Eclipse
Now, the layouting of the message flows is very simple:
Select any process model in the project explorer.
Invoke the “BPMN Beautifier” with a single click on the “External Tools” icon in the toolbar.
Refresh the process model.
Continue to view and edit the beautified process model.
Unfortunately, when moving elements the beautified layout of the message flows may be destroyed. This can easily be corrected by just executing the “BPMN Beautifier” again.