I want to create one custom element which its base XML is like this:
<startEvent>
<extensionElements>
<flowable:eventType xmlns:flowable="http://flowable.org/bpmn"><![CDATA[lll]]></flowable:eventType>
<flowable:eventOutParameter xmlns:flowable="http://flowable.org/bpmn" source="aa" sourceType="string" target="aa"></flowable:eventOutParameter>
<flowable:channelKey xmlns:flowable="http://flowable.org/bpmn"><![CDATA[ppp]]></flowable:channelKey>
<flowable:channelType xmlns:flowable="http://flowable.org/bpmn"><![CDATA[kafka]]></flowable:channelType>
</extensionElements>
</startEvent>
Is this one metamodel or one event type ? what is the difference between them?
nikku
February 28, 2023, 9:43am
2
What exactly do you want to accomplish? Create a flowable BPMN diagram? Why not use the flowable on board facilities for it?
If you want to support a custom vendor extensions you can use any elements to create them:
moddle.createAny('eventType', 'http://flowable.org/bpmn', {
$body: '<![CDATA[lll]]>'
});
Alternatively you create a custom moddle schema for it.
I want to create one custom element which has startEvent, extensionElements and flowable:eventType like image shown above.
Now I have one custom element using palette like below. But when I drag it into diagram, its icons will become startEvent default icon.
function createRSE(event) {
const shape = elementFactory.create('shape', { type: 'bpmn:StartEvent' });
if ( document.$modeler) {
const modeler = document.$modeler
const moddle = modeler.get("moddle");
const flowableEventType = moddle.create('flowable:EventType', {
'xmlns:flowable': "http://flowable.org/bpmn"
})
flowableEventType.body = '8888'
let extensionElements = moddle.create('bpmn:ExtensionElements', {
values: [flowableEventType]
})
extensionElements.$parent = shape
shape.businessObject.extensionElements = extensionElements
}
create.start(event, shape);
}
'create.registry-start-event': {
type: 'bpmn:MessageEventDefinition',
group: 'events',
className: 'bpmn-icon-start-event-message',
title: translate('Create RSE'),
action: {
dragstart: createRSE,
click: createRSE
}
},
Where should I fix?