diff --git a/lib/features/rules/BpmnRules.js b/lib/features/rules/BpmnRules.js index 6164702a..cf618af5 100644 --- a/lib/features/rules/BpmnRules.js +++ b/lib/features/rules/BpmnRules.js @@ -803,6 +803,10 @@ function canConnectDataAssociation(source, target) { function canInsert(shape, flow, position) { + if (!flow) { + return false; + } + if (Array.isArray(shape)) { if (shape.length !== 1) { return false; diff --git a/test/spec/features/rules/BpmnRules.moveLane.bpmn b/test/spec/features/rules/BpmnRules.moveLane.bpmn new file mode 100644 index 00000000..a611a111 --- /dev/null +++ b/test/spec/features/rules/BpmnRules.moveLane.bpmn @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/spec/features/rules/BpmnRulesSpec.js b/test/spec/features/rules/BpmnRulesSpec.js index dc3eb06c..1d5e184b 100644 --- a/test/spec/features/rules/BpmnRulesSpec.js +++ b/test/spec/features/rules/BpmnRulesSpec.js @@ -1666,4 +1666,32 @@ describe('features/modeling/rules - BpmnRules', function() { }); + + describe('integration', function() { + + describe('move Lane', function() { + + var testXML = require('./BpmnRules.moveLane.bpmn'); + + beforeEach(bootstrapModeler(testXML, { modules: testModules })); + + + it('should disallow', inject(function(elementRegistry, rules) { + + // given + var lane = elementRegistry.get('Lane_1'); + + // when + var result = rules.allowed('elements.move', { + shapes: [ lane ] + }); + + // then + expect(result).to.be.false; + })); + + }); + + }); + });