AnsweredAssumed Answered

History and multi instance SubProcess

Question asked by iam on Jan 6, 2016
Latest reply on Jan 20, 2016 by jbarrez
Hi, guys.
I'm playing with retrieving historical sequence way for process instance and was confused a little bit by the case with multi instance sub process (not a call activity).
I have SubProcess with loop cardinality 3 and there are some activities in the sub process.
When I get historical activity instances like that:

    List<HistoricActivityInstance> historicActivityInstances = historyService.createHistoricActivityInstanceQuery()
        .processInstanceId(processInstanceId).orderByHistoricActivityInstanceStartTime().asc().list();

I can not determine which subprocess loop instance contains which activities.

Real example: I have three phones and multi instance sub process for this three phones. Each instance will make call and analyze call result code to send SMS when no answer. After that I want to know (and see) each way for each sub process instance.
Is it possible?
Yes, I know I can use call activity, but my actualy goal is retrieve correct sequence way for any type of designed processes.

And one strange thing more: executionId of the first sub process instance looks strange - i.e. "9" when other instances have "20" and "22". I expected something like 18, I've analized tables and dont understand why ACT_HI_ACTINST has executionId "9" as scope just for the first instance.
I tried to retrieve historical variables:

historyService.createHistoricVariableInstanceQuery().executionId("9").list()

Historic variables for executionId=9 realy looks like scope variables with "nrOfInstances" and other two (20 and 22) have "loopCounter".
The question is: where is my loopCounter for the first instance? :)

Outcomes