Awesome
@bpmn-io/element-template-icon-renderer
A bpmn-js extension to render element template icons.
Use Extension
Install via npm:
npm install @bpmn-io/element-template-icon-renderer
Use in your bpmn-js powered editor:
import ElementTemplateIconRenderer from '@bpmn-io/element-template-icon-renderer';
const viewer = new BpmnViewer({
additionalModules: [
...,
ElementTemplateIconRenderer
]
});
Optionally you may configure where you read your icons from:
import ElementTemplateIconRenderer from '@bpmn-io/element-template-icon-renderer';
const viewer = new BpmnViewer({
additionalModules: [
...,
ElementTemplateIconRenderer
],
elementTemplateIconRenderer: {
iconProperty: 'foo:icon' // read from <bpmn:task foo:icon="..." />
}
});
In case you want to model with the element template icons, make sure you include the respective moddle extension to create the icon, i.e. zeebe-bpmn-moddle
:
import zeebeModdle from 'zeebe-bpmn-moddle/resources/zeebe.json';
const modeler = new BpmnModeler({
additionalModules: [
...,
ElementTemplateIconRenderer
],
moddleExtensions: {
zeebe: zeebeModdle
}
});
Run locally
To run the renderer example, execute:
npm start