Currently working on finding a mechanism for adding new elements to the businessObject directly. These are not modelling elements so i cannot add or remove them via the modeller itself.
Having issues with finding details on how i can programmatically update the businessObject.
I have created a complex element which i am trying to append onto the businessObject, but cannot seem to find out how this is done.
Here is the code for creating the element.
const extElement = elementHelper.createElement("bpmn:ExtensionElements", {}, businessObject, bpmnFactory)
const root = elementHelper.createElement("bpsim:BPSimData", {}, extElement, bpmnFactory)
const scenario = elementHelper.createElement("bpsim:Scenario", attributes, root, bpmnFactory)
elementHelper.createElement("bpsim:ScenarioParameters", {}, scenario, bpmnFactory)
elementHelper.createElement("bpsim:ElementParameters", {}, scenario, bpmnFactory)
As you can see i am using the elementHelper from bpmn-js-properties-panel/ElementHelper.js at master · bpmn-io/bpmn-js-properties-panel · GitHub
From this i would suspect that setting the parent attribute would be a mechanism for adding the element to the businessObject, but apparently not?
Any and all pointers are always appreciated!
Thanks
Herman
Edit:
found some useful references, will have a look at these.
1 - Can't create nested tags in Timer Event ExtensionElements
2 - Add extensionElements to process - #8 by orentoga
3 - Walkthrough | bpmn.io (this should be mandatory reading for all bpmn-js novices. Cleared up a lot of the the questions that i had)