Sure I can provide a bit more context. As you might see, this is still a mess, because I’m trying a lot of things.
function ActivatePQCPalette(canvas, create, eventBus, palette, elementFactory, overlays, moddle, bpmnjs, elementRegistry, toolManager, editPQCTool) {
this._create = create;
this._elemntFactory = elementFactory;
this._editPQCTool = editPQCTool;
palette.registerProvider(this);
var root = canvas.getRootElement();
var businessObject = root.businessObject;
var id = businessObject.id;
console.log(id);
eventBus.on('shape.added', function(event){
var ev_element = event.element;
if(ev_element.type === 'bpmn:EndEvent'){
overlays.add( ev_element.id,{
position:{
bottom: 0,
right: 0
},
html: ActivatePQCPalette.ACCORDION_HTML
});
}
});
console.log(palette);
eventBus.on('diagram.init', function(event){
console.log(event);
});
}
ActivatePQCPalette.$inject = ['canvas', 'create', 'eventBus', 'palette', 'elementFactory', 'overlays', 'moddle', 'bpmnjs', 'elementRegistry', 'toolManager', 'editPQCTool'];
The error message I get is:
unhandled error in event listener index.js:103595
TypeError: bo.get is not a function index.js:103596
at getTemplateId (index.js:14489)
at getTemplateOptions (index.js:15512)
at module.exports (index.js:15458)
at createGeneralTabGroups (index.js:13627)
at CamundaPropertiesProvider.getTabs (index.js:13871)
at PropertiesPanel.update (index.js:8913)
at index.js:8743
at invokeFunction (index.js:103679)
at EventBus._invokeListener (index.js:103581)
at EventBus._invokeListeners (index.js:103569)
If this works I’m still not sure if this is the ID I’m looking for. Because this would be the ID of the RootElement. I’m looking for the ID in the XML Header.
I’m seeing this on Camunda Modeler Nightly from 2 days ago.
One more question:
I’m seeing no difference between using the line
ActivatePQCPalette.$inject = ['canvas', 'create', 'eventBus', 'palette', 'elementFactory', 'overlays', 'moddle', 'bpmnjs', 'elementRegistry', 'toolManager', 'editPQCTool'];
and not using this line in my extension. I can simply pass the names of these modules in my function and it works without the $inject part. Should I use it or leave it?
Thanks for all your help by the way. I’m very glad about it.