diff --git a/lib/import/BpmnTreeWalker.js b/lib/import/BpmnTreeWalker.js index b9cc6d1b..c0dc5f94 100644 --- a/lib/import/BpmnTreeWalker.js +++ b/lib/import/BpmnTreeWalker.js @@ -315,11 +315,6 @@ function BpmnTreeWalker(handler) { if (lane.childLaneSet) { handleLaneSet(lane.childLaneSet, newContext || context); - } else { - var filterList = filter(lane.flowNodeRef, function(e) { - return e.$type !== 'bpmn:BoundaryEvent'; - }); - handleFlowElements(filterList, newContext || context); } } @@ -332,40 +327,11 @@ function BpmnTreeWalker(handler) { } function handleFlowElementsContainer(container, context) { - if (container.laneSets) { handleLaneSets(container.laneSets, context); - handleNonFlowNodes(container.flowElements, context); - } else { - handleFlowElements(container.flowElements, context); } - } - function handleNonFlowNodes(flowElements, context) { - forEach(flowElements, function(e) { - - if (isHandled(e)) { - return; - } - - if (is(e, 'bpmn:SequenceFlow')) { - deferred.push(function() { - handleSequenceFlow(e, context); - }); - } else if (is(e, 'bpmn:BoundaryEvent')) { - deferred.unshift(function() { - handleBoundaryEvent(e, context); - }); - } else if (is(e, 'bpmn:FlowNode')) { - handleFlowNode(e, context); - } else if (is(e, 'bpmn:DataObject')) { - // SKIP (assume correct referencing via DataObjectReference) - } else if (is(e, 'bpmn:DataStoreReference')) { - handleDataElement(e, context); - } else if (is(e, 'bpmn:DataObjectReference')) { - handleDataElement(e, context); - } - }); + handleFlowElements(container.flowElements, context); } function handleFlowElements(flowElements, context) { diff --git a/test/spec/import/ImporterSpec.js b/test/spec/import/ImporterSpec.js index d1f405a3..75823631 100644 --- a/test/spec/import/ImporterSpec.js +++ b/test/spec/import/ImporterSpec.js @@ -252,7 +252,7 @@ describe('import - Importer', function() { // when runImport(diagram, xml, function(err, warnings) { - expect(warnings.length).to.equal(1); + expect(warnings.length).to.equal(0); done(err); }); diff --git a/test/spec/import/ModelWiringSpec.js b/test/spec/import/ModelWiringSpec.js index 8c6b4c80..f29ce0e0 100644 --- a/test/spec/import/ModelWiringSpec.js +++ b/test/spec/import/ModelWiringSpec.js @@ -144,16 +144,15 @@ describe('import - model wiring', function() { beforeEach(bootstrapViewer(xml)); - it('should wire parent child relationship', inject(function(elementRegistry) { + it('should import flowElements as children of Participant', inject(function(elementRegistry) { // when - var laneShape = elementRegistry.get('Lane'), - participantShape = elementRegistry.get('Participant_Lane'), + var participantShape = elementRegistry.get('Participant_Lane'), taskShape = elementRegistry.get('Task'), sequenceFlowElement = elementRegistry.get('SequenceFlow'); // then - expect(taskShape.parent).to.eql(laneShape); + expect(taskShape.parent).to.eql(participantShape); expect(sequenceFlowElement.parent).to.eql(participantShape); })); @@ -167,7 +166,7 @@ describe('import - model wiring', function() { beforeEach(bootstrapViewer(xml)); - it('should wire parent child relationship', inject(function(elementRegistry) { + it('should import flowElements as children of Participant', inject(function(elementRegistry) { // when var participantShape = elementRegistry.get('Participant_Lane'),