Variable history in multiInstance subprocess

Hello,

i have run across a problem when trying to retrieve some local variables using historyService for an ended process.

image

I have a process that at one point runs subprocess with multiInstanceLoopCharacteristics. Inside there is a serviceTask that sets a local variable and waits for a webservice call from outside. So, as there are several instances of subprocess, there are several instances of the same variable. Each subprocess has its own executionId and i can see the flow path in ACT_HI_ACTINST table. The created variables are visible in ACT_HI_VARINST but their executionId are different than the executionId of the subprocess. Still in ACT_RU_EXECUTION table i can find the executionId of the variable, and its parent_id (which is the executionId of the subprocess), so i can match the variable with subprocess.

The problem appears when all subprocesses (so the main process itself) is ended. The table ACT_RU_EXECUTION gets purged and i no longer have the data necessary to map each variable with each subprocess instance.
I may of course retrieve all the variables, but i don’t know which variable value was for which subprocess.

Im creating a reporting plugin that should show the variable value for each subprocess (also for finished ones).

Do i need to change to process definition ;/, or is there any way to retrieve it using Camunda API, and i missed something…

Help appreciated, cheers.

1 Like

Hi @jacek.koziel - did you ever figure this out?