We’ve got element templates working for events, sequence flows and tasks in version 0.4 of the properties panel. Now, we’re updating to version 1.0-alpha and the templates are still valid, existing models are working properly with the existing templates.
But when adding a new element, we see the button + Select but nothing happens when that gets clicked.
It looks like nothing is listening to the event elementTemplates.select - is that intentional? I’ve checked the eventBus and there is really nothing there. Do we have to write our own selector? If so, I’d need some help. What I managed to do is
cool you are updating to the latest propPanel version!
Indeed, with 1.0.0-alpha.0 we removed the element template select, so your observation is correct, nothing is listing on the elementTemplates.select event. See CHANGELOG.
We are already considering how to improve the situation (e.g., provide a default, or give a good example how to implement an easy solution). See issue.
For now, you would have to look into how the Camunda Modeler implements this feature as an example.
Thanks @maxtru for your feedback. I’ll see if I can get something up and running later this week. I had a quick look into the Camunda implementation but not sure yet if I can do something similar outside of Camunda - or how many dependencies would get into my way.
Hey there, I subscribed to the elementTemplates.select event to open a dialog with a little selection to select a element template. It’s all working fine, but how do I apply the selected element template to the BPMN?
this.bpmnJS.on("elementTemplates.select", ({ element }) => {
this.dialog
.open(ElementTemplatesDialogComponent, {
// TODO load element templates within dialog
data: { elementTemplates: [...] },
})
.afterClosed()
.subscribe((elementTemplate) => {
// TODO how to apply it to the BPMN Model?
});
});