chore(import): compute FlowNode#lanes
This commit is contained in:
parent
7af6d916ce
commit
4be7324856
|
@ -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 {
|
||||
|
|
|
@ -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 ]);
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue