diff --git a/lib/import/BpmnTreeWalker.js b/lib/import/BpmnTreeWalker.js index c0dc5f94..8ce175ec 100644 --- a/lib/import/BpmnTreeWalker.js +++ b/lib/import/BpmnTreeWalker.js @@ -316,6 +316,8 @@ function BpmnTreeWalker(handler) { if (lane.childLaneSet) { handleLaneSet(lane.childLaneSet, newContext || context); } + + wireFlowNodeRefs(lane); } function handleLaneSet(laneSet, context) { @@ -383,6 +385,17 @@ function BpmnTreeWalker(handler) { } + function wireFlowNodeRefs(lane) { + // wire the virtual flowNodeRefs <-> relationship + forEach(lane.flowNodeRef, function(flowNode) { + var lanes = flowNode.get('lanes'); + + if (lanes) { + lanes.push(lane); + } + }); + } + ///// API //////////////////////////////// return { diff --git a/test/spec/import/ModelWiringSpec.js b/test/spec/import/ModelWiringSpec.js index f29ce0e0..516fe6c6 100644 --- a/test/spec/import/ModelWiringSpec.js +++ b/test/spec/import/ModelWiringSpec.js @@ -156,6 +156,19 @@ describe('import - model wiring', function() { expect(sequenceFlowElement.parent).to.eql(participantShape); })); + + it('should wire FlowElement#lanes', inject(function(elementRegistry) { + + // when + var taskShape = elementRegistry.get('Task'), + task = taskShape.businessObject, + laneShape = elementRegistry.get('Lane'), + lane = laneShape.businessObject; + + // then + expect(task.get('lanes')).to.eql([ lane ]); + })); + });