-
Since I upgraded to Theia v1.29.2 and GLSP Client v1.1.0-RC03 I see the following log message each time a selection changed in my diagram:
I have a custom implementation of a properyPanel wich implements The custom implementation looks (simplified) like this: @injectable()
export class BPMNPropertyPanel extends AbstractUIExtension implements EditModeListener, SelectionListener {
@inject(SelectionService)
protected selectionService: SelectionService;
@postConstruct()
postConstruct(): void {
console.log('...running postConstruct');
this.editorContext.register(this);
this.selectionService.register(this);
}
selectionChanged(root: Readonly<SModelRoot>, selectedElements: string[]): void {
// first we need to verify if a Symbol/BPMNLabel combination was selected.
// In this case we are only interested in the BPMNFlowElement and not in the label
if (selectedElements.length > 1) {
const filteredArr = selectedElements.filter(val => !val.endsWith('_bpmnlabel'));
selectedElements = filteredArr;
}
.........
}
} ... and the binding like this: export const bpmnPropertyModule = new ContainerModule((bind, unbind, isBound,rebind) => {
bind(BPMNPropertyPanel).toSelf().inSingletonScope();
bind(TYPES.IUIExtension).to(BPMNPropertyPanel);
}); We already had a discussion about this topic how to register an UIExtension and a MouseListener And as an alternative I previously had this way to register my UIExtension: bind(BPMNPropertyPanel).toSelf().inSingletonScope();
bind(TYPES.IUIExtension).toService(BPMNPropertyPanel); But the error message is always the same. The behavior did not change - but the panel works still as expected. Maybe the problem is, that my UIExtension is in a separate module? This is the way I bind the module with my ContainerModule: export default function createBPMNDiagramContainer(widgetId: string): Container {
// Create the createClientContainer with the diagramModule and the BPMN bpmnPropertyModule...
const container = createClientContainer(bpmnDiagramModule, bpmnPropertyModule);
overrideViewerOptions(container, {
baseDiv: widgetId,
hiddenDiv: widgetId + '_hidden'
});
return container;
} At least it looks like I'm doing something wrong here. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 4 replies
-
I have now analyzed the problem in more detail. I removed all of my modules and code dealing with the SelectionService. The Error message is still there and as a follow up issue the workspace in theia is no longer stored (see also discusson here). In the moment when I open a GLSP editor the exceptin is thrown. It is not necessary to select an element in the diagram:
To me it seems to be an issue related to
Can someone confirm this issue? |
Beta Was this translation helpful? Give feedback.
-
I tried now theia version ^1.27.0 - but with the same result |
Beta Was this translation helpful? Give feedback.
-
Even if I remove all bindings from my glsp client I still have this issue. @eclipse-glsp/theia-integration/src/browser/diagram/glsp-diagram-context-key-service.ts |
Beta Was this translation helpful? Give feedback.
-
I run with theia version 1.29.2 The result fo the commands look like this:
|
Beta Was this translation helpful? Give feedback.
-
@rsoika I found the cause for the issue. Its just a minor oversight in your dependency definition for |
Beta Was this translation helpful? Give feedback.
-
Yes you are right. Removing the caret (^) solved the issue. Thanks a lot! How can I avoid this problem that I always have different versions in the different modules in my project. In Maven you can work with $ variables defined once in the parent project to avoid such conflicts. Because I still have so much problems with |
Beta Was this translation helpful? Give feedback.
@rsoika I found the cause for the issue. Its just a minor oversight in your dependency definition for
open-bpmn-theia
.You defined your dependency to the
@eclipse-gslp/theia-integration
with a leading caret (^
) which means any minor or patch version greater than 1.1.0 is valid. In your case yarn resolved this dependency to@eclipse-glsp/[email protected]
.So you ended up with two different theia-integration versions which caused the DI configuration to break.
Luckily the fix is easy, simply remove the leading
^
and you are good to go