Automatically layout BPMN diagram on import


#1

Is there any way to place all connection elements at appropriate position automatically,when importing "bpmn-js diagram?


#2

You would like your diagrams to be automatically laid out on open? Why is that? Does the diagram not contain graphical information yet?


#3

It has graphical information but it has untidy connections. Every connection has only two (start and end) way-points.

When we move an element, bpmnjs tries to improve the way other elements connect to that element (by changing its connection’s way-points after we drop the element I guess).

Is there any way we can do that on all connections? (for example after loading)


#4

We already do something something similar to fix broken element dockings in the ImportDockingFix behavior.

You could write a similar behavior and use our existing layout facilities (BpmnLayouter#layoutConnection) to correct the waypoints of imported connections.