diff --git a/lib/features/rules/BpmnRules.js b/lib/features/rules/BpmnRules.js index d907e9b3..6164702a 100644 --- a/lib/features/rules/BpmnRules.js +++ b/lib/features/rules/BpmnRules.js @@ -420,7 +420,7 @@ function canConnect(source, target, connection) { function canDrop(element, target, position) { // can move labels everywhere - if (isLabel(element) && !isConnection(target)) { + if (isLabel(element)) { return true; } diff --git a/test/spec/features/rules/BpmnRules.collaboration.bpmn b/test/spec/features/rules/BpmnRules.collaboration.bpmn index 22d5a5d7..4c1b2470 100644 --- a/test/spec/features/rules/BpmnRules.collaboration.bpmn +++ b/test/spec/features/rules/BpmnRules.collaboration.bpmn @@ -1,9 +1,11 @@ - + + + @@ -21,23 +23,32 @@ - + + SequenceFlow + - + + SequenceFlow + + - + + + DataStoreReference + + @@ -140,6 +151,25 @@ + + + + + + + + + + + + + + + + + + + diff --git a/test/spec/features/rules/BpmnRulesSpec.js b/test/spec/features/rules/BpmnRulesSpec.js index 3ac39ce3..dc3eb06c 100644 --- a/test/spec/features/rules/BpmnRulesSpec.js +++ b/test/spec/features/rules/BpmnRulesSpec.js @@ -924,7 +924,6 @@ describe('features/modeling/rules - BpmnRules', function() { it('drop TextAnnotation_Global -> Participant', inject(function() { - expectCanDrop('TextAnnotation_Global', 'Participant', true); })); @@ -934,13 +933,55 @@ describe('features/modeling/rules - BpmnRules', function() { }); - it('drop element -> collapsed Participant', inject(function(canvas) { + it('drop element -> collapsed Participant', inject(function() { expectCanDrop('StartEvent_None', 'CollapsedParticipant', false); expectCanDrop('SubProcess', 'CollapsedParticipant', false); expectCanDrop('Task_in_SubProcess', 'CollapsedParticipant', false); expectCanDrop('TextAnnotation_Global', 'CollapsedParticipant', false); })); + + describe('drop MessageFlow label', function() { + + var label; + + beforeEach(inject(function(elementRegistry) { + label = elementRegistry.get('MessageFlow_labeled').label; + })); + + + it('-> MessageFlow', function() { + expectCanDrop(label, 'MessageFlow_labeled', true); + }); + + + it('-> CollapsedParticipant', function() { + expectCanDrop(label, 'CollapsedParticipant', true); + }); + + + it('-> Collaboration', function() { + // then + expectCanDrop(label, 'Collaboration', true); + }); + + + it('-> Task_in_SubProcess', function() { + expectCanDrop(label, 'Task_in_SubProcess', true); + }); + + + it('-> SequenceFlow', function() { + expectCanDrop(label, 'SequenceFlow', true); + }); + + + it('-> DataOutputAssociation', function() { + expectCanDrop(label, 'DataOutputAssociation', true); + }); + + }); + });