dbera / BPMN_Viewer

This is an extension of the BPMN.io app
MIT License
1 stars 0 forks source link

Saved file does not comply with BPMN 2.0 #9

Open dbera opened 3 months ago

raulmonti commented 3 months ago

See for instance this example model:

image

In particular element <bpmn4s:targetDataRef>DataObjectReference_0rvq74x</bpmn4s:targetDataRef> in the generated xml:

<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:bpmn4s="http://bpmn4s" id="sample-diagram" targetNamespace="http://bpmn.io/schema/bpmn" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
  <bpmn2:process id="Process_1" isExecutable="false">
    <bpmn2:subProcess id="Activity_1rvd56r" name="Component1" bpmn4s:component="true">
      <bpmn2:dataOutputAssociation id="DataOutputAssociation_0kkkahh" bpmn4s:sourceDataRef="DataObjectReference_10gh1uy">
        <bpmn2:targetRef>DataObjectReference_10gh1uy</bpmn2:targetRef>
        <bpmn4s:targetDataRef>DataObjectReference_0rvq74x</bpmn4s:targetDataRef>
      </bpmn2:dataOutputAssociation>
      <bpmn2:dataObjectReference id="DataObjectReference_0rvq74x" name="msgqueue1" dataObjectRef="DataObject_0twisms" bpmn4s:queue="true" bpmn4s:originDataRef="DataOutputAssociation_0kkkahh" />
      <bpmn2:dataObject id="DataObject_0twisms" />
    </bpmn2:subProcess>
    <bpmn2:dataObjectReference id="DataObjectReference_10gh1uy" name="msgqueue1" dataObjectRef="DataObject_13dbpzn" bpmn4s:queue="true" />
    <bpmn2:dataObject id="DataObject_13dbpzn" />
  </bpmn2:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
      <bpmndi:BPMNShape id="DataObjectReference_10gh1uy_di" bpmnElement="DataObjectReference_10gh1uy">
        <dc:Bounds x="652" y="230" width="36" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="641" y="287" width="58" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_1rvd56r_di" bpmnElement="Activity_1rvd56r">
        <dc:Bounds x="440" y="210" width="100" height="80" />
        <bpmndi:BPMNLabel />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="DataOutputAssociation_0kkkahh_di" bpmnElement="DataOutputAssociation_0kkkahh">
        <di:waypoint x="540" y="250" />
        <di:waypoint x="652" y="250" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
  <bpmndi:BPMNDiagram id="BPMNDiagram_19vuafl">
    <bpmndi:BPMNPlane id="BPMNPlane_092s6ra" bpmnElement="Activity_1rvd56r">
      <bpmndi:BPMNShape id="DataObjectReference_0rvq74x_di" bpmnElement="DataObjectReference_0rvq74x">
        <dc:Bounds x="634" y="200" width="36" height="50" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="623" y="257" width="58" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn2:definitions>
raulmonti commented 3 months ago

This is what you get when you try to load it in bpmn.io online editor: image The problem is that we are missing to nest this element in the ExtensionElements element. Also notice that ExtensionElements should always be first child of other elements.