How to connect shapes with incomplete waypoints


I’m having a bit of trouble understanding how to extend bpmn to allow connecting shapes when connector waypoints are incomplete. By incomplete I mean that when waypoints are present within an XML, the default renderer (layouter?) assumes the source and target are there.

If, for example, I get an array of waypoints for a line with two bends - it only has those two bends as points and does not include the source or target. How can I ensure that when I import the XML the line will correctly link to a source and target? Currently it just draws a line between the points it has, neither end connecting to a task. Unfortunately, I don’t have a way to modify the service that generates the waypoints.

I’ve read through a lot of the examples in Github and given on this forum but so far I have had no success.

How do you end up with a diagram with missing waypoints? Was it created with another tool?

Yes, it comes from another tool. We are trying to keep two diagrams in sync by passing waypoints back and forth. However, the other tool only stores the mid-points. If it’s just a straight line between two tasks, then it does not have any waypoints. If it’s a line with a single bend, then I only get one point back. Since that tool isn’t extendable I thought the best place might be reconfiguring how bpmn takes in waypoints and connects parts of the diagram.

Can you please share a sample diagram and the name of the tool?

I believe you could build a bpmn-js extension which could just add the missing waypoints in case the first or the last waypoint is not within start/end element bounds.