Set Time Attributes

I know there’s already a threat about this topic here. At that time timer attributes weren’t supported on bpmn-js.

I wanted to ask what the status of this is and if there is a workaround that provides undo/redo capabilities.

I’ve been trying this in a few different ways but without any luck.

var timeAttribute = moddle.create('bpmn:timeCycle', {
  body: value
});

modeling.updateProperties(startEventElement, {
  timerEventDefinition: timeAttribute
});

and this is the error i get:
Handler::set is not defined for timerEventDefinition Error: unknown type <bpmn:timeCycle>

Am i missing anything here?

Thank you

You’re trying to set the event definition to the time cycle. The time cycle is a property of the event definition:

<bpmn:startEvent id="StartEvent_1">
  <bpmn:timerEventDefinition>
    <bpmn:timeCycle xsi:type="bpmn:tFormalExpression">foo</bpmn:timeCycle>
  </bpmn:timerEventDefinition>
</bpmn:startEvent>
1 Like