diff --git a/lib/features/replace/BpmnReplace.js b/lib/features/replace/BpmnReplace.js index d4170f1e..52f76fab 100644 --- a/lib/features/replace/BpmnReplace.js +++ b/lib/features/replace/BpmnReplace.js @@ -296,8 +296,8 @@ function BpmnReplace(bpmnFactory, moddle, popupMenu, replace, selection, modelin switch (entry.actionName) { case 'replace-with-default-flow': if (businessObject.sourceRef.default !== businessObject && - is(businessObject.sourceRef, 'bpmn:ExclusiveGateway') || - is(businessObject.sourceRef, 'bpmn:InclusiveGateway')) { + (is(businessObject.sourceRef, 'bpmn:ExclusiveGateway') || + is(businessObject.sourceRef, 'bpmn:InclusiveGateway'))) { menuEntries.push(addMenuEntry(entry, function() { modeling.updateProperties(element.source, { default: businessObject }); diff --git a/test/spec/features/replace/BpmnReplace.defaultFlowsFromInclusiveGateways.bpmn b/test/spec/features/replace/BpmnReplace.defaultFlowsFromInclusiveGateways.bpmn new file mode 100644 index 00000000..29aa6a1b --- /dev/null +++ b/test/spec/features/replace/BpmnReplace.defaultFlowsFromInclusiveGateways.bpmn @@ -0,0 +1,48 @@ + + + + + SequenceFlow_1 + + + + SequenceFlow_1 + SequenceFlow_2 + + + SequenceFlow_2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/spec/features/replace/BpmnReplaceSpec.js b/test/spec/features/replace/BpmnReplaceSpec.js index 41008604..01114b68 100644 --- a/test/spec/features/replace/BpmnReplaceSpec.js +++ b/test/spec/features/replace/BpmnReplaceSpec.js @@ -925,6 +925,37 @@ describe('features/replace', function() { }); + describe('default flows from inclusive gateways', function () { + + var diagramXML = require('./BpmnReplace.defaultFlowsFromInclusiveGateways.bpmn'); + + beforeEach(bootstrapModeler(diagramXML, { modules: testModules })); + + it ('should show Default replace option', inject(function (elementRegistry, bpmnReplace) { + // given + var sequenceFlow = elementRegistry.get('SequenceFlow_2'); + + // when + var opts = bpmnReplace.getReplaceOptions(sequenceFlow); + + // then + expect(opts).to.have.length(1); + })); + + it ('should NOT show Default replace option', inject(function (elementRegistry, bpmnReplace) { + // given + var sequenceFlow = elementRegistry.get('SequenceFlow_1'); + + // when + var opts = bpmnReplace.getReplaceOptions(sequenceFlow); + + // then + expect(opts).to.have.length(1); + })); + + }); + + describe('default flows', function() { var diagramXML = require('./BpmnReplace.defaultFlows.bpmn');