diff --git a/lib/features/modeling/rules/BpmnRules.js b/lib/features/modeling/rules/BpmnRules.js index 00b24c98..922d6b00 100644 --- a/lib/features/modeling/rules/BpmnRules.js +++ b/lib/features/modeling/rules/BpmnRules.js @@ -399,5 +399,5 @@ function canInsert(shape, flow) { return ( is(flow, 'bpmn:SequenceFlow') || is(flow, 'bpmn:MessageFlow') - ) && canDrop(shape, flow.parent); + ) && is(shape, 'bpmn:FlowNode') && canDrop(shape, flow.parent); } \ No newline at end of file diff --git a/test/spec/features/modeling/behavior/CreateOnFlowBehaviorSpec.js b/test/spec/features/modeling/behavior/CreateOnFlowBehaviorSpec.js index 9d5f80bc..cebd6312 100644 --- a/test/spec/features/modeling/behavior/CreateOnFlowBehaviorSpec.js +++ b/test/spec/features/modeling/behavior/CreateOnFlowBehaviorSpec.js @@ -137,6 +137,30 @@ describe('modeling/behavior - drop on connection', function(){ { original: { x: 502, y: 299 }, x: 502, y: 299 } ]); })); + }); + + + describe('rules', function() { + + it('should not insert participant', inject(function(rules, elementRegistry, elementFactory) { + + // given + var participantShape = elementFactory.createShape({ type: 'bpmn:Participant' }); + + var sequenceFlow = elementRegistry.get('SequenceFlow'); + + var position = { x: 340, y: 120 }; // first bendpoint + + // when + var canDrop = rules.allowed('shape.create', { + shape: participantShape, + parent: sequenceFlow, + position: position + }); + + // then + expect(canDrop).toBe(false); + })); });