Invalid Route error when triggering request model action after adding new edge #1420
-
Hey there, I have hooked up GLSP diagrams to a Langium source model. My ModelStorage triggers a RequestModelAction when it receives a document change event from the Langium language client. When I create a new edge or node, I send an event out to Langium to create it and then it triggers a document change, this is picked up by my ModelStorage which then recreates my diagram model from the updated source model. For the most part this works okay, however I get an invalid route error from the layout utils via a ChangeBoundsAction whenever I create a new edge in the diagram. I'm assuming doing it this way is bypassing some code that adds the routing points but I can't figure out what or how to resolve it. I tried adding routing points in my gmodel factory to ensure that they were always added but that had no effect because the newRoutingPoints on the ChangeBoundsAction was still empty. I also tried adding a placeholder edge to my diagram model, which does work in displaying the new edge but I still get the invalid route error. Any thoughts? Kind Regards |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi Jonathan, There is a very similar setup in CrossModel. However, I cannot see any particular handling of the routing points in the creation of a relationship or in the change bounds action. Typically, routing points are created using the calcElementAndRoutingPoints utility function which in turn uses registered edge routers as part of the standard routingModule. This is what gets send to the server. Do you set a particular Kind regards, |
Beta Was this translation helpful? Give feedback.
Hi Martin,
Thanks for the response, oddly after fixing some issues with my nodes I haven't ran into this problem again.
Kind Regards,
Jonathan