ch-lukas commented on PR #3652: URL: https://github.com/apache/incubator-kie-tools/pull/3652#issuecomment-4924199313
Thanks @jomarko I'd like to answer your questions with some background, and a few questions of my own. **What I'm attempting to fix** Using an E2E test screenshot from the repo as an example: connection layouts could be optimised, as BAs tend to model BPMN diagrams left-to-right / top-down using horizontal connections where they can. These connections are fixed to their anchor points, so if you move the nodes the layout doesn't auto-optimise, and the only way to tidy it up is to re-anchor or recreate each connection using the centred anchor points. https://github.com/apache/incubator-kie-tools/blob/main/packages/bpmn-editor/tests-e2e/__screenshots__/Google-Chrome/flowElements/complete-process-with-call-activity.png?raw=1 **Connection layout algorithms** Three common connection layouts: <img width="1125" height="375" alt="Screenshot 2026-07-09 at 11 30 16" src="https://github.com/user-attachments/assets/ff605677-3ea9-4c94-93c2-f9bc0f9b143c" /> **Option 1 - straight segments, no diagonals** Pretty common for sequence flows in the main process. Clean layout with only horizontal/vertical segments that stick to the grid, though each connection ends up with several bend points. **Option 2 - facing-side midpoint (recommendation)** This is already the default in places - e.g. if you create a connected node from the popup quick menu, the connection uses the centred anchor point on both source and target, and always attaches at the midpoint of the facing side. Connections to text annotations and data objects commonly use this too. This is the algorithm the PR would like to standardise across all node types (focusing on the source nodes, and leaving placed connection anchors on target nodes as-is). **Option 3 - shortest-path** This is what you get today if you already have both nodes and draw a connection between their centre anchors. Similar to option 2 but allows shorter, diagonal lines, so the anchor point isn't always the facing-side midpoint. Worth noting that both option 2 and option 3 are currently implemented, so it might be good to agree on what the centre anchor point should mean. **Design questions** - What should using the centre anchor point mean - always find the best facing side to attach to, or always try to create the shortest connection? - Should the centre anchor point algorithm be standardised across the different ways of creating connections? - When moving nodes that have placed anchor points, should those be optimised (facing-side midpoint or shortest-path), and should the optimisation also apply to the connected node's anchor point? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
