diff --git a/lib/features/rules/BpmnRules.js b/lib/features/rules/BpmnRules.js index 895421b8..c3eab9ff 100644 --- a/lib/features/rules/BpmnRules.js +++ b/lib/features/rules/BpmnRules.js @@ -128,6 +128,10 @@ BpmnRules.prototype.init = function() { return canConnect(element.source, element.target, element); } + if (element.host) { + return canAttach(element, element.host, null, position); + } + return canCreate(element, target, null, position); }); }); diff --git a/test/spec/features/rules/BpmnRulesSpec.js b/test/spec/features/rules/BpmnRulesSpec.js index a0bd74cf..3fe6e2b5 100644 --- a/test/spec/features/rules/BpmnRulesSpec.js +++ b/test/spec/features/rules/BpmnRulesSpec.js @@ -81,6 +81,36 @@ describe('features/modeling/rules - BpmnRules', function() { expectCanCreate([ task1, task2, sequenceFlow ], 'Process', false); })); + + it('create task and non-interrupting boundary event', inject(function(elementFactory) { + + // given + var task = elementFactory.createShape({ type: 'bpmn:Task' }), + boundaryEvent = elementFactory.createShape({ + type: 'bpmn:BoundaryEvent', + eventDefinitionType: 'bpmn:EscalationEventDefinition', + cancelActivity: false, + host: task + }); + + // then + expectCanCreate([ task, boundaryEvent ], 'Process', true); + })); + + + it('create task and interrupting boundary event', inject(function(elementFactory) { + + // given + var task = elementFactory.createShape({ type: 'bpmn:Task' }), + boundaryEvent = elementFactory.createShape({ + type: 'bpmn:BoundaryEvent', + eventDefinitionType: 'bpmn:EscalationEventDefinition', + host: task + }); + + // then + expectCanCreate([ task, boundaryEvent ], 'Process', true); + })); });