bpmn-elements
bpmn-elements copied to clipboard
ParallelLoop task index Bug?
src/tasks/LoopCharacteristics.js from line 169:
ParallelLoopCharacteristics.prototype._onCompleteMessage = function onCompleteMessage(routingKey, message) {
const chr = this.characteristics;
const {
content
} = message;
if (content.output !== undefined) chr.output[content.index] = content.output;
if (routingKey === 'execute.discard') {
this.discarded++;
}
this.running--;
this.activity.broker.publish('execution', 'execute.iteration.completed', {
...content,
...chr.getContent(),
index: this.index, // >>>>>>> this line
running: this.running,
discarded: this.discarded,
output: chr.output,
state: 'iteration.completed',
preventComplete: true
});
The marked line should probably be removed, as the index is already included in the content, whereas in parallel tasks, the value of this.index = tasks.length +1 after the parallel tasks are started in batches