For a parallel multi-instance, each iteration has a unique execution id, but it looks like all iterations of a sequential multi-instance have the same execution id. I would like to know how I can get the local variables used for each iteration of the sequential multi-instance.
You can use this variable to concatenate with the name of a variable you want and thus have direct access to the variable referring to the multi-instance you want.
For example, if your variable is “personName”, and your multi-instance will have 30 persons, you create the variable dynamically by searching for the value of the current running loopCounter through execution.getvariable(“loopCounter”)… and then concatenating the loopCounter value with the name of the variable.
I am looking for a REST call that I can use without having to create new variables. For example, this POST /history/variable-instance with query parameters
I believe that /history/variable-instance endpoint should return the variable instances of the named variable item. Keep in mind that activities are created sequentially and so on element variables.
It looks like you are calling the API while only first instance has been created and it hasn’t been completed yet so the remaining instances including their item variable are not created yet because multi-instance activity is configured to run sequentially.
Yes, you’re correct.
I conducted a small test and found that
In sequential multi-instance situations, the same activity instance is used one after another, so only one value is kept.