After the completion of a Parallel Multi-Instance Call Activity, my created json variable keeps only the values from the last completed instance


#1

Hi there,

I have the following Collaboration diagram:

My issue here is that on the completion of the Multi-Instance Subprocess (the bottom Pool which is called by the Parallel Multi-Instance Call Activity), my created (via camForm function) json variable (“selectedProduct”) keeps only the submitted values from the last completed instance.
Does anyone know please how can I update (by appending each time the new submitted values) this json variable each time an instance is completed in the Subprocess ?

Thank you in advance,
Steve


#2

Hi Steve,

Could you please upload your bpmn xml.


#3

Hi @Yana and thanks for your feedback :slightly_smiling_face:

I’m going to upload it here on evening because I haven’t got access on my bpmn file now.

Cheers,
Steve


#4

Hi @steftriant

The documentation for Multi-Instance tasks says the following:

A multi-instance activity ends when all instances are finished.

That means, that all the subprocesses are executed before the process gets to your last task. And the problem you are having is, that every subprocess of your multi-instance writes the output to the same result variable. So this variable gets constantly overwritten and only contains the result of the last iteration.

So you should consider creating an object that holds all the results of the subprocesses.

Here is a good forum post that helped me to improve the usage of my multi-instance tasks:

I suggest you implement it similar to this example and collect the results of your multi-instance-tasks after avery instance on your own.

Regards
Michael


#5

Hi @Yana.

Here, is my bpmn file:
Multi-Instance Call Activity.bpmn (7.3 KB)

Please let me explain the main points :

  1. On the completion of the 1st task in the Main Process (Create a List of Products), a json array variable (“product”) is created via camForm function inside an html form and 6 instances of the task in the Subprocess (Select Products from the List) are created and assigned to 6 users.

  2. On the completion of the task in the Subprocess (“Select Products from the List”), a new json array variable (“selectedProduct”) is created via camForm function inside an other html form.

  3. What I want to achieve here is to append the submitted values to this json variable (“selectedProduct”) each time an instance of the task (“Select Products from the List”) is completed. Now, when I complete the Multi-Instance Subprocess, this json variable (“selectedProduct”) keeps only the submitted values of the last completed instance.

Hope this make sense :slightly_smiling_face:

Thanks a lot,
Steve


#6

Hi @MichiDahm and thanks also for your feedback :slightly_smiling_face:

Ok, I’m going to look through @StephenOTT’s suggested forum post here and I will let you know for any result.

Cheers,
Steve