fix(bpmn-ordering-provider): handle external labels seperately

closes #606
This commit is contained in:
Philipp Fromme 2016-08-16 14:39:37 +02:00 committed by Nico Rehwaldt
parent 14ae66e5bb
commit 681869fb44
3 changed files with 25 additions and 3 deletions

View File

@ -22,7 +22,6 @@ function BpmnOrderingProvider(eventBus, translate) {
OrderingProvider.call(this, eventBus);
var orders = [
{ type: 'label', order: { level: 10 } },
{ type: 'bpmn:SubProcess', order: { level: 6 } },
{
type: 'bpmn:SequenceFlow',
@ -54,6 +53,10 @@ function BpmnOrderingProvider(eventBus, translate) {
];
function computeOrder(element) {
if (element.labelTarget) {
return { level: 10 };
}
var entry = find(orders, function(o) {
return isAny(element, [ o.type ]);
});

View File

@ -209,4 +209,23 @@ describe('features/modeling - ordering', function() {
});
describe('labels', function() {
var diagramXML = require('./ordering.bpmn');
beforeEach(bootstrapModeler(diagramXML, { modules: testModules }));
it('should always be in front', inject(function() {
// when
move('SequenceFlow_label', { x: 500, y: 0 }, 'Collaboration', false);
// then
expectZOrder('Collaboration', 'Participant', 'SequenceFlow_label');
}));
});
});

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="_Sp0bEEZWEeW8AbPIK3dKxg" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="0.7.0-dev" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:definitions xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="_Sp0bEEZWEeW8AbPIK3dKxg" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.2.2" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:collaboration id="Collaboration">
<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:collaboration>
<bpmn2:process id="Process_Tasks" isExecutable="false">
<bpmn2:sequenceFlow id="SequenceFlow" name="" sourceRef="BoundaryEvent" targetRef="Task" />
<bpmn2:sequenceFlow id="SequenceFlow" name="SequenceFlow" sourceRef="BoundaryEvent" targetRef="Task" />
<bpmn2:boundaryEvent id="BoundaryEvent" name="" attachedToRef="Task_With_Boundary">
<bpmn2:outgoing>SequenceFlow</bpmn2:outgoing>
</bpmn2:boundaryEvent>