Skip to content

Commit b951e45

Browse files
committed
Added template code for lanes (not active)
1 parent b22722b commit b951e45

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/converters/grammar/BPMNListener.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ export class BPMNListener implements SentenceParser {
355355
let shapes = [];
356356

357357
let i = 0;
358+
358359
// add tasks
359360
for (const label of this.tasks.keys()) {
360361
let element = moddle.create('bpmn:Task', { id: this.tasks.get(label), name: label });
@@ -367,6 +368,7 @@ export class BPMNListener implements SentenceParser {
367368
}));
368369
i++;
369370
}
371+
370372
// add gateways
371373
for (const gateway of this.gateways) {
372374
let element = moddle.create((gateway.type === 'PARALLEL' ? 'bpmn:ParallelGateway' : 'bpmn:ExclusiveGateway'), { id: gateway.id });
@@ -379,6 +381,7 @@ export class BPMNListener implements SentenceParser {
379381
}));
380382
i++;
381383
}
384+
382385
// add start and end events
383386
let start_element = moddle.create('bpmn:StartEvent', { id: BPMNListener.START_EVENT });
384387
elements.push(start_element);
@@ -396,6 +399,7 @@ export class BPMNListener implements SentenceParser {
396399
bpmnElement: end_element,
397400
bounds: moddle.create('dc:Bounds', { x: 350, y: 100, width: 36, height: 36 })
398401
}));
402+
399403
// add flows
400404
for (const flow of this.flows) {
401405
let element = moddle.create('bpmn:SequenceFlow', {
@@ -413,12 +417,27 @@ export class BPMNListener implements SentenceParser {
413417
}));
414418
}
415419

420+
// add lanes -- currently not exported
421+
// const laneSet = moddle.create('bpmn:LaneSet', { id: 'LaneSet_1', lanes: [] });
422+
// let lanesTmp = [];
423+
// for (const role of this.roles.keys()) {
424+
// let lane = moddle.create('bpmn:Lane', { id: role, name: role });
425+
// let laneFlowElements = [];
426+
// for (const activity of this.roles.get(role)) {
427+
// laneFlowElements.push(allElements.get(activity));
428+
// }
429+
// lane.flowNodeRef = laneFlowElements;
430+
// lanesTmp.push(lane);
431+
// laneSet.lanes.push(lane);
432+
// }
433+
416434
// Create a BPMN model
417435
const process = moddle.create('bpmn:Process', {
418436
id: 'Process_1',
419437
isExecutable: true,
420438
flowElements: elements,
421439
});
440+
// process.laneSets = [laneSet];
422441

423442
// Create BPMN diagram elements (needed for visualization)
424443
const bpmnDiagram = moddle.create('bpmndi:BPMNDiagram', {

0 commit comments

Comments
 (0)