-
In my last question I described a routing behavior losing waypoints. As I described it was more a problem with the Now I try again to describe the core problem one more: When you have a edge with custom routing points like in the picture below, GLSP provides only one routing point. In BPMN we store the model with 3 routing points as we include the anchor points too. It is difficult for me to describe the problem clearly. But I think the core of my issue are the missing anchor points. So it may be not a problem that can be solved on the server part. It seems to be more inside the router on the client side. My expectation would be that the anchor point is protected by the router during moving the element. But as you can see the anchor point (that does not exist in my GModel) is lost during moving. Now I wonder if this is a general problem that can't be easily solved in GLSP (only be rewriting the router) or is it just the fact that I need to (somehow) define the anchor points also in the GModel ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I did more testing and also tried a solution with custom Anchor Points. Finally I came to the conclusion, that the problem is routing algorithm of the Manhattan router itself. So my final question here is: How can I extend the GLSP Manhattan router or implement my own routing algorithm ? |
Beta Was this translation helpful? Give feedback.
-
Hi @rsoika, to customize the rebind(GLSPManhattanEdgeRouter).to(YoucCustomRouter).inSingletonScope(); Alternatively if you want to create our own routing algorithm you can configure a new @injectable()
export class MyCustomRouter extends AbstractEdgeRouter {
static readonly KIND = 'custom';
//...
}
@injectable()
export class CustomRectangleAnchorComputer implements IAnchorComputor {
static KIND = MyCustomRouter.KIND + ':' + RECTANGULAR_ANCHOR_KIND;
//...
}
/...
// di config
bind(TYPES.IEdgeRouter).to(MyCustomRouter);
bind(TYPES.IAnchorComputer).to(CustomRectangleAnchorComputer)
bind(TYPES.IAnchorComputer).to(CustomEllipticAnchorComputer)
bind(TYPES.IAnchorComputer).to(CustomDiamonAnchorComputer) |
Beta Was this translation helpful? Give feedback.
Hi @rsoika,
to customize the
GLSPManhattanEdgeRouter
simply create a subclass that extendGLSPManhattanEdgeRouter
and rebind it accordingly in your diagram moduleAlternatively if you want to create our own routing algorithm you can configure a new
IEdgeRouter
. There is an abstract base class (AbstractEdgeRouter
) that you can use as starting point.Note that you also of to configure
IAnchorComputer
for your custom router. Typically you need at least anchor computer for the Ellipse,Rectangle and Diamond anchors: