Hi. Apologies in advance if this is a basic question. But if an element is added to a diagram, I can get to that element’s object by using the element registry. But if that element has a child element in the XML then the element registry doesn’t seem to give me access to that.
For instance, given this XML element:
<bpmn:timerEventDefinition id="TimerEventDefinition_08vc3yw" />
I can get to
bpmn:intermediateCatchEvent using the element registry. But it’s children property is always empty.
I’ve also tried using
getAll in the element registry but the
bpmn:timerEventDefinition element is not returned by those functions either.
So how can I get access to the
What you are looking for is the
eventDefinitions property of the
businessObject of the shape that you’re dealing with.
Please have a look at this example: https://codesandbox.io/s/practical-taussig-ecypq?file=/src/index.js
In line #43, we
eventDefinitions of given event. Which is an array.
Thanks loads for that, big help.
But now I have the event definitions, is there a way to update them, e.g to add a child element?
For example, I am trying to achieve something like this:
<bpmn:timeCycle id="_erIyiZZ7EeSDh8PHobjSSA" language="cron">0/1 * * * * ?</bpmn:timeCycle>
Can that be done?
We’d like to have different forum threads for each question as it’s easier to search later on for other users as well.
Could you ask your new question in a separate thread please?
Apologies, makes sense. I’ve created this new topic - Add to or update event definitions