fix(ordering): render group elements on collaboration level

Closes #1043
This commit is contained in:
Niklas Kiefer 2019-05-29 08:09:36 +02:00 committed by merge-me[bot]
parent 93a4a579dd
commit 46c5a8cb36
4 changed files with 51 additions and 9 deletions

View File

@ -63,7 +63,16 @@ export default function BpmnOrderingProvider(eventBus, canvas, translate) {
}
},
{ type: 'bpmn:BoundaryEvent', order: { level: 8 } },
{ type: 'bpmn:Group', order: { level: 10 } },
{
type: 'bpmn:Group',
order: {
level: 10,
containers: [
'bpmn:Collaboration',
'bpmn:Process'
]
}
},
{ type: 'bpmn:FlowElement', order: { level: 5 } },
{ type: 'bpmn:Participant', order: { level: -2 } },
{ type: 'bpmn:Lane', order: { level: -1 } }

View File

@ -91,6 +91,16 @@ describe('features/modeling - ordering', function() {
}));
it('should stay behind Group', inject(function() {
// when
move('Participant', 'Collaboration');
// then
expectZOrder('Participant_StartEvent', 'Participant', 'Group');
}));
it('should stay behind DataInputAssociation when moving Participant with DataStore', inject(function() {
// when
@ -321,6 +331,16 @@ describe('features/modeling - ordering', function() {
expectZOrder('SubProcess', 'Group');
}));
it('move <Group> onto <Participant>', inject(function() {
// when
move('Group', { x: 50, y: 0 }, 'Participant', false);
// then
expectZOrder('Participant', 'Group');
}));
});
});

View File

@ -3,28 +3,37 @@
<category id="Category_1">
<categoryValue id="CategoryValue_1" value="my group" />
</category>
<collaboration id="Collaboration_1">
<participant id="Participant" processRef="Process_1" />
<group id="Group" categoryValueRef="CategoryValue_1" />
</collaboration>
<process id="Process_1" processType="None" isExecutable="false">
<startEvent id="StartEvent" />
<task id="Task" />
<subProcess id="SubProcess" />
<group id="Group" categoryValueRef="CategoryValue_1" />
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
<bpmndi:BPMNShape id="Group_1di" bpmnElement="Group">
<omgdc:Bounds x="180" y="105" width="188" height="154" />
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collaboration_1">
<bpmndi:BPMNShape id="Participant_di" bpmnElement="Participant" isHorizontal="true">
<omgdc:Bounds x="156" y="118" width="724" height="250" />
<bpmndi:BPMNLabel>
<omgdc:Bounds x="184" y="107" width="58.28571319580078" height="15" />
<omgdc:Bounds x="184" y="107" width="59" height="15" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="StartEvent_0yve8vf_di" bpmnElement="StartEvent">
<omgdc:Bounds x="450" y="164" width="36" height="36" />
<omgdc:Bounds x="192" y="242" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_0nb7h9d_di" bpmnElement="Task">
<omgdc:Bounds x="418" y="268" width="100" height="80" />
<omgdc:Bounds x="280" y="150" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="SubProcess_02cid6e_di" bpmnElement="SubProcess" isExpanded="true">
<omgdc:Bounds x="546" y="138" width="350" height="200" />
<omgdc:Bounds x="430" y="138" width="350" height="200" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Group_1di" bpmnElement="Group">
<omgdc:Bounds x="220" y="73" width="270" height="387" />
<bpmndi:BPMNLabel>
<omgdc:Bounds x="286" y="75" width="46" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>

View File

@ -4,6 +4,7 @@
<bpmn2:participant id="Participant" name="Participant" processRef="Process_Tasks" />
<bpmn2:participant id="Participant_StartEvent" name="Participant_StartEvent" processRef="Process_StartEvent" />
<bpmn2:messageFlow id="MessageFlow" name="" sourceRef="Task_With_Boundary" targetRef="Participant_StartEvent" />
<bpmn2:group id="Group"/>
</bpmn2:collaboration>
<bpmn2:process id="Process_Tasks" isExecutable="false">
<bpmn2:sequenceFlow id="SequenceFlow" name="SequenceFlow" sourceRef="BoundaryEvent" targetRef="Task" />
@ -96,6 +97,9 @@
<bpmndi:BPMNShape id="Task_0vcqjeq_di" bpmnElement="Task_With_Output">
<dc:Bounds x="747" y="473" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Group_di" bpmnElement="Group">
<dc:Bounds x="250" y="73" width="270" height="287" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="DataOutputAssociation_1fcd0id_di" bpmnElement="DataOutputAssociation">
<di:waypoint x="797" y="473" />
<di:waypoint x="797" y="209" />