fix(features/bpmn-modeling): correctly remove flow from outgoing/incoming

Related to #6
This commit is contained in:
Nico Rehwaldt 2014-07-18 15:10:33 +02:00
parent f1b023f419
commit 1947a9c4de
2 changed files with 6 additions and 2 deletions

View File

@ -89,8 +89,8 @@ BpmnFactory.prototype.createDiEdge = function(sequenceFlow, points, attrs) {
BpmnFactory.prototype.disconnectSequenceFlow = function(sequenceFlow) { BpmnFactory.prototype.disconnectSequenceFlow = function(sequenceFlow) {
Collections.remove(sequenceFlow.sourceRef && sequenceFlow.sourceRef.get('outgoing'), sequenceFlow.sourceRef); Collections.remove(sequenceFlow.sourceRef && sequenceFlow.sourceRef.get('outgoing'), sequenceFlow);
Collections.remove(sequenceFlow.targetRef && sequenceFlow.targetRef.get('incoming'), sequenceFlow.targetRef); Collections.remove(sequenceFlow.targetRef && sequenceFlow.targetRef.get('incoming'), sequenceFlow);
_.extend(sequenceFlow, { _.extend(sequenceFlow, {
sourceRef: null, sourceRef: null,

View File

@ -179,6 +179,10 @@ describe('features - bpmn-modeling', function() {
// then // then
expect(connection.sourceRef).toBe(null); expect(connection.sourceRef).toBe(null);
expect(connection.targetRef).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(connection.$parent).toBe(null);
expect(subProcess.di.$parent.get('planeElement')).not.toContain(connection.di); expect(subProcess.di.$parent.get('planeElement')).not.toContain(connection.di);