Hi folks,
We’re developing a custom properties panel for the Bpmn.io modeler and have an issue creating the elements in the ‘camunda’ namespace.
Quite stuck at the moment so any help is greatly appreciated.
Ours is a Angular 9 project.
The related libraries we import:
"bpmn-js": "^7.2.0",
"bpmn-js-properties-panel": "^0.35.0",
"camunda-bpmn-moddle": "^4.4.0",
The way we create the modeler:
import camundaModdleExtension from 'camunda-bpmn-moddle/lib';
import * as camundaModdle from 'camunda-bpmn-moddle/resources/camunda.json';
import * as camundaPropertiesProvider from 'bpmn-js-properties-panel/lib/provider/camunda';
import * as BpmnJS from 'bpmn-js/dist/bpmn-modeler.production.min.js';
// Omitted for brevity
this.modeler = new BpmnJS({
container: '#canvas',
keyboard: {
bindTo: document
},
additionalModules: [
camundaModdleExtension,
camundaPropertiesProvider,
// Also tried the below
// { ['camundaPropertiesProvider']: ['type', camundaPropertiesProvider.propertiesProvider[1]] },
// { ['camundaExtensionModule']: ['type', camundaModdleExtension] },
],
moddleExtensions: {
camunda: camundaModdle
}
});
The way we get the moddle and try to create a ‘camunda’ element:
let modeling = modeler.get('modeling');
let moddle = modeling._elementFactory._moddle;
let connector = moddle.create('camunda:Connector', {
});
The last statement in the code above causes the ERROR Error: unknown type camunda:Connector error.
The ‘bpmn’ elements are created with no issues.
One thing we noticed that may be related - if we print out the moddle we see packages in the registry:
"registry": {
"packageMap": {
"bpmn": {
"name": "BPMN20",
...
"bpmndi": {
"name": "BPMNDI",
...
"undefined": {
"default": {
"name": "Camunda",
Looks like the camunda package is not registered right - however we have not been able to figure out the cause.
Any ideas please?
Thanks,
Andrey.