chore(import): compute FlowNode#lanes

This commit is contained in:
Nico Rehwaldt 2015-10-15 23:49:52 +02:00 committed by pedesen
parent 7af6d916ce
commit 4be7324856
2 changed files with 26 additions and 0 deletions

View File

@ -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 {

View File

@ -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 ]);
}));
});