AnsweredAssumed Answered

Request on history doesn't follow logic flow order but Xml sequence order

Question asked by cnirparis on Jun 18, 2014
Latest reply on Jun 27, 2014 by jbarrez
I've noticed something strange.
When you modify your BPMN XML using the Activiti Model Editor (in Eclipse), for example if you insert an user task before the rest of the existing flow, the XML tag of new entity is added at the end of the XML.
It's not a problem because the targetRef and sourceRef of sequenceFlows let the engine find the correct flow order.

But some API apparently don't.
For example, this piece of code works but gives list of unfinished tasks not in logic flow order, but in order in which they appear in the BPMN XML :

      List<HistoricActivityInstance>  tList =
                MyHistoryService.createHistoricActivityInstanceQuery()
                .processDefinitionId(MyProcessInstance.getProcessDefinitionId())
                .unfinished()
                .list();


I've fixed modifiying by hand my XML and make the sequential order of XML tags matching the flow logic order.
Is that normal, or have I made a mistake somewhere ?

Outcomes