-
I'm trying to use a custom ChangeBoundsHandler in my GLSP server, but I'm getting a strange error I'm not sure how to interpret. For reference, my ChangeBoundsHandler is like so:
I am also attempting to use this handler here:
I'm receiving the following error when starting up the GLSP server, however:
I know that the method of implementing custom handlers has changed, as it used to be as simple as
and now requires a different setup, but I'm not sure what this error is trying to tell me, either. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @david-pa, the error is telling you that there is already another @injectable()
export class CustomDiagramModule extends GModelDiagramModule {
...
protected override configureOperationHandlers(binding: InstanceMultiBinding<OperationHandlerConstructor>): void {
binding.add(CustomChangeBoundsHandler);
super.configureOperationHandlers(binding);
}
} The @injectable()
export class CustomDiagramModule extends GModelDiagramModule {
...
protected override configureOperationHandlers(binding: InstanceMultiBinding<OperationHandlerConstructor>): void {
super.configureOperationHandlers(binding);
binding.rebind(GModelChangeBoundsOperationHandler, CustomChangeBoundsHandler);
}
} |
Beta Was this translation helpful? Give feedback.
Hi @david-pa,
the error is telling you that there is already another
OperationHandler
registered for the same operation kind ("changeBounds").The problem is in your diagram module:
The
super.configureOperationHandlers
also adds aChangeBoundsOperationHandler
implementation.You have to use
binding.rebind
instead ofadd
: