When deleting Participant all custom values on the Process element get lost


#1

When we delete the Participant element from the diagram the Process element seem to get recreated with some default values. All custom values get lost. Even custom elements inside extensionElements are lost.

How to reproduce:

  • Open online modeler https://demo.bpmn.io/new
  • Open this simple XML that has a Process element with a custom value in the Id attribute
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="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" id="Definitions_1dwi72d" targetNamespace="http://bpmn.io/schema/bpmn">
  <bpmn:process id="Process_CustomId">
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_CustomId">
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

  • Drag a Participant element from the toolbar to the diagram
  • Delete the newly created Participant element
  • Download the diagram via “Download BPMN diagram” button
  • Open downloaded XML and observe that the process Id has changed
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" id="Definitions_1dwi72d" targetNamespace="http://bpmn.io/schema/bpmn">
  <bpmn:process id="Process_0jenv2z" />
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_0jenv2z" />
  </bpmndi:BPMNDiagram>
</bpmn:definitions>


#2

As of now this is the expected behavior. Deleting the last remaining participant will turn the collaboration into a process, adding a participant will do the opposite. By replacing the root element with the ID will change. Feel free to create a feature request in the corresponding repository if you’d want this to change.