diff --git a/lib/features/bpmn-modeling/BpmnFactory.js b/lib/features/bpmn-modeling/BpmnFactory.js index 01957a5c..b97b3099 100644 --- a/lib/features/bpmn-modeling/BpmnFactory.js +++ b/lib/features/bpmn-modeling/BpmnFactory.js @@ -89,8 +89,8 @@ BpmnFactory.prototype.createDiEdge = function(sequenceFlow, points, attrs) { BpmnFactory.prototype.disconnectSequenceFlow = function(sequenceFlow) { - Collections.remove(sequenceFlow.sourceRef && sequenceFlow.sourceRef.get('outgoing'), sequenceFlow.sourceRef); - Collections.remove(sequenceFlow.targetRef && sequenceFlow.targetRef.get('incoming'), sequenceFlow.targetRef); + Collections.remove(sequenceFlow.sourceRef && sequenceFlow.sourceRef.get('outgoing'), sequenceFlow); + Collections.remove(sequenceFlow.targetRef && sequenceFlow.targetRef.get('incoming'), sequenceFlow); _.extend(sequenceFlow, { sourceRef: null, diff --git a/test/spec/browser/features/bpmn-modeling/BpmnModelingSpec.js b/test/spec/browser/features/bpmn-modeling/BpmnModelingSpec.js index b9c28b0e..95e89509 100644 --- a/test/spec/browser/features/bpmn-modeling/BpmnModelingSpec.js +++ b/test/spec/browser/features/bpmn-modeling/BpmnModelingSpec.js @@ -179,6 +179,10 @@ describe('features - bpmn-modeling', function() { // then expect(connection.sourceRef).toBe(null); expect(connection.targetRef).toBe(null); + + expect(startEvent.get('outgoing')).not.toContain(connection); + expect(target.get('incoming')).not.toContain(connection); + expect(connection.$parent).toBe(null); expect(subProcess.di.$parent.get('planeElement')).not.toContain(connection.di);