Hi,
I want to create the following startEvent with outgoing and timeEventDefinition as sub element.
<bpmn:startEvent id="StartEvent_1y9irep">
<bpmn:outgoing>Flow_0sqgplm</bpmn:outgoing>
<bpmn:timerEventDefinition id="TimerEventDefinition_03yikjg" />
</bpmn:startEvent>
I’m creating startEvent as follows :
let StartEvent = moddle.create('bpmn:StartEvent', {
id: 'StartEvent_1y9irep',
})
;
which gives me
<bpmn2:startEvent id="StartEvent_1y9irep" />
How do i add outgoing and timeEventDefinition to startEvent.
Can you please help me with this.
Regards,
Pratik
nikku
2
What you’re basically doing is instantiating a new instance of bpmn:StartEvent
. You’d need to instantiate and pass the bpmn:TimerEventDefinition
, too.
Please check with bpmn-moddle
, specifically the BPMN meta-model to learn which elements are allowed in a start event.
It will tell you that a bpmn:StartEvent
is a bpmn:Event
that contains a list of eventDefinitions
. You’ll thus end up with something like this:
const event = moddle.create('bpmn:StartEvent', {
eventDefinitions: [
moddle.create('bpmn:TimerEventDefinition', { ... })
],
...
});
1 Like
I have found there are no RegisterStartEvent in BPMN meta-model, how can I add this event type?
nikku
5