Hi all,
First of all thank you for your great work and providing your product also as open source.
Currently I am working on an atomated translation of a DSL I provided during a running PhD project to BPMN. The DSL deals with realworld services as well as technical services, which are grounded on an ontological sound basis. Basically the DSL supports a sub-set of BPM concepts, such as roles, subprocesses, user task, service task, parallelity etc.
I am using your Fluent API to generate BPMN elements based on services models described in my DSL. Works great so far. The only issue is that I encounter relates to the waypoints generated:
I love hearing stories from academia. Thanks for sharing this!
As to your question, I assume that you are using the Java API (and not BPMN.io).
The in-build layouting is not very sophisticated, as you have observed yourself. In this particular example, the block-structured model makes it easy to improve the layout:
find all gateways with more than one incoming sequence flow
find all respective sequence flows
add waypoints:
Waypoint: right mid-point of source. If source and target are not horizontally aligned, add
Waypoint: horizontally aligned with first source, vertically aligned with target.
Waypoint: bottom mid-point of target
Note, calculating and adding these waypoints is not possible in the fluent API. I’d add a post-processing step instead.
The following snippet may aid as a starting point:
List<SequenceFlow> sequenceFlows = (List<SequenceFlow>) model.getModelElementsByType(SequenceFlow.class);
for (SequenceFlow sf : sequenceFlows) {
if (!(sf.getTarget() instanceof Gateway)) {
continue;
}
...
Waypoint wp = model.newInstance(Waypoint.class);
wp.setX(...);
wp.setY(...);
sf.getDiagramElement().getWaypoints().add(wp);
}
Hi Stephan,
Many thanks your quick response!
You are right. I use the Fluent API to construct the model. BPMN.io is only used for visualizing the result.
Blond question: Which class holds the DI specific coordinates? Looked at DiagramElement but there are no position nor location related attributes…
Best,
Meikel