bpmn-io / bpmn-moddle

Read and write BPMN 2.0 XML from JavaScript.
MIT License
444 stars 162 forks source link

How to insert a child element between bpmn:diagram tag which is the parent tag using bpmn-moddle? #99

Closed shsrivastava754 closed 1 year ago

shsrivastava754 commented 1 year ago
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
      <bpmndi:BPMNEdge id="Flow_1jne4it_di" bpmnElement="Flow_1jne4it">
        <di:waypoint x="-495" y="-380" />
        <di:waypoint x="-465" y="-380" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1dha7c2_di" bpmnElement="Flow_1dha7c2">
        <di:waypoint x="185" y="-230" />
        <di:waypoint x="235" y="-230" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="Activity_18hvm8y_di" bpmnElement="Activity_18hvm8y">
        <dc:Bounds x="-765" y="-440" width="270" height="120" />
      </bpmndi:BPMNShape>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
marstamm commented 1 year ago

What is you use case? A BPMNDiagram is only allowed one Plane each. If you want to have multiple diagrams, you need to create multiple Diagrams.

https://github.com/bpmn-io/bpmn-moddle/blob/ea7fa6a94c55f49fe1da1f019dc9a40d62967252/resources/bpmn/json/bpmndi.json#L9-L13

As this is a general question and not a bug or feature request, I am closing this issue. For general questions please use our forum: https://forum.bpmn.io/