AnsweredAssumed Answered

ExecutionQuery does not contain unpersisted process instance

Question asked by michael.amann on Oct 2, 2012
Latest reply on Oct 3, 2012 by jbarrez

I'm currently experiencing troubles when trying to receive a "process call hierarchy" before the process instance is persisted to the activiti database.

The following scenario is causing me headache:

Process A is started from a unit test and the first activity is a call activity that references Process B. The first activity in Process B is a service task where I want to query the process call hierarchy (implemented as Spring bean).

So all I'm doing in the service task is to call:
In this scenario the result list is empty, even though two process instances should appear.

As soon as I add a user task before the service task and complete it before performing the query above, the list of results consists of the expected two entries.

Does anyone have an idea how to solve this? I need a way to query all executions, nevertheless if the process instance was paused already or not. So in other words, in the result list of createExecutionQuery() I would like to see

- all running processes as found in the database
- all running processes not yet commited

How could I achieve that?