Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An alternative Manhattan Router #1442

Open
rsoika opened this issue Dec 7, 2024 · 2 comments
Open

An alternative Manhattan Router #1442

rsoika opened this issue Dec 7, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@rsoika
Copy link

rsoika commented Dec 7, 2024

Hi, I have implemented an extension from the GLSP Manhattan Router. This router takes care of custom routing when moving elements. In difference to the origin router the router tries to protect the existing routing during moving elements:

Peek 2024-12-07 16-34

The router registers a MouseListener to track the move event and updates the computed route from the origin router. It simply adjusts the first two routing points of out going edges and the last two routing points of in going edges

bpmn-manhattan-router.txt

I am not sure if this is something that makes sense for you project. We need this in our BPMN project and I need to improve it in some more details, so I just post now the core implementation of this routing concept.

@rsoika rsoika added the enhancement New feature or request label Dec 7, 2024
@tortmayr
Copy link
Contributor

Hi @rsoika,
thanks for reaching out.
Your router implementation already looks very promising and is definitely something that would also be interesting for GLSP.
Maybe we can come back to this once you cleaned up/improved you solution?
And then we can discuss how to best integrate this into the core framework.

@rsoika
Copy link
Author

rsoika commented Dec 13, 2024

I have no better code than the one I posted here in the file 'bpmn-manhattan-router.txt'.
My further development is using internal Open-BPMN Features that are specific to my project. The main issue for me was to identify the correct element when a mouse-click event was triggered.

To sum it up: in general I simply tack the mouse click event to register the element to be moved. In the routing method I first call the standard behavior and next I look if we have a custom waypoint in the routing. If so, I adjust the position of this waypoint (the last one for incomming, and the first one for outgoing edges) with the same offset I have recorded before.
here you can see my current implementation with my custom method 'isBPMNElement'.

I guess you find better (more elegant) ways to compute/track the move-event?
An integration into the standard router should be possible by defining a new option to activate this adjustment of the existing waypoints - if you think the solution/idea is somehow useful....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants