AnsweredAssumed Answered

Execution Query

Question asked by kayj on Nov 6, 2014
Latest reply on Dec 11, 2014 by kayj
Hi,

I've got a quite simple example:


ProcessEngine processEngine = ProcessEngineConfiguration
        .createStandaloneInMemProcessEngineConfiguration()
        .buildProcessEngine();

RepositoryService repositoryService = processEngine.getRepositoryService();
RuntimeService runtimeService = processEngine.getRuntimeService();

repositoryService.createDeployment().addClasspathResource( "diagrams/automationProcess.bpmn20.xml").deploy();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey( "automationProcessId");
      
List<Execution> executions = runtimeService.createExecutionQuery().list();


The process instance gets started correctly, 2 tasks are executed until a boundary event is reached which is waiting for a signal. The documentation says that:
"An Execution represents a 'path of execution' in a process instance. Note that a ProcessInstance also is an execution." (http://activiti.org/javadocs/org/activiti/engine/runtime/Execution.html)

Therefore I would assume that the length of the executions list must be 1 (due to the processInstance that was started). But it is empty. Even though the process is waiting for a signal, the execution should be still available or am I wrong?

If I query the historic instances instead the list returns 1.
Furthermore I figured out that the length of the execution list is 1 if the boundary event is removed.

Could someone try to explain this behaviour?

Outcomes