We recently converted a BPMN plugin to a client extension (Use registerClientExtension() instead of registerBpmnJSPlugin() and make the plugin a React component), However, I cannot find a way to listen to the menu event.
Here is the menu.js we have:
Itâs possible to get the editorActions from the modeler inside a Client Extension. Youâll have to listen to the bpmn.modeler.configure event and then register your bpmn-js extension. You can have a look at this example. Itâs showcased how to register bpmn-js-extension via a client extension. Inside that, you would be able to register new actions.
Feel free to ask further questions if you need help
Thank you for the response @Niklas_Kiefer! I tried the example and I am able to listen to the events now. But the problem is that when there is no BPMN tab open, the event wonât be triggered, is there a way that we can call ipcRenderer.emit in the menu.js so the client extension can listen to the event even if there is no BPMN file open?
We are adding a tree-like library to the modeler, so the user can set their default library folder and switch between the BPMN files easily.
The event is to set the folder path of the library, even if there are no open BPMN files, the user should be able to set their library folder path.
Once we enable the node integration, how do we access the ipcRenderer in menu.js?
Thank you!
We are listening to the event in a React component which is used as a client extension.
Hmm, the problem is that ipcMain doesnât have an emit function so I cannot use it to trigger the events.