bpmn-elements icon indicating copy to clipboard operation
bpmn-elements copied to clipboard

ParallelLoop task index Bug?

Open eyes4 opened this issue 9 months ago • 1 comments

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

eyes4 avatar May 17 '24 16:05 eyes4