I am trying to define my own PropretiesProvider for the BpmnModeler but I’m failing miserably.
- I am trying to use bpmn modeler and create a custom properties provider
- I am working with
- I am using React, which should not be an issue but who knows
Error I get
TypeError Cannot add property __, object is not extensible
Steps to reproduce
- clone this repository
- npm install
- npm run storybook
- Open http:// localhost:6006 in your browser
- Click on BpmnModeler → Camunda, click on elements and see custom properties showing on the right
- Click on BpmnModeler → Function PP (or Class PP)
- Click on the StartEvent and see the error message
The idea is that I made one component that receives additionalModules and moddleExtension as parameters, allowing me to tests a few things.
Code & issue highlights
There are 3 ways I’m using the BpmnModeler
- The first is directly using the CamundaPropertiesProvider and moddle. It works perfectly
- The second one named Function PP using the MagicPropertiesProvider defined as a function as shown in the example (
bpmn-io/bpmn-js-examples/blob/master/properties-panel-extension/app/provider/magic/MagicPropertiesProvider.js). This one fails with above error when a click occurs on the StartEvent circle within the Diagram
- The third one named Class PP using the MagicClassPropertiesProvider defined as a class (
src/stories/bpmnjs/core/magicUsingClass/MagicClassPropertiesProvider.js) , following what has been done with Camunda official
CamundaPlatformPropertiesProvider.js. This last one also fails like the one defined as a function
I really don’t know why I cannot make this work, I even tried to copy / paste the magic example directly from the examples repository but still had the issue.
- Within Storybook, we can see that the CamundraPropertiesProvider is passed to the BpmnModeler as a class. Whereas for the others the PropertiesProviders appears as “function”. Don’t know if that’s something to look into
- Sadly, I CANNOT upload more images because I’m a new user…
Thanks for your help !