cancel
Showing results for 
Search instead for 
Did you mean: 

HistoricProcessInstance inside ExecutionListener

yerbol777
Champ in-the-making
Champ in-the-making
Hi,
i am trying to get inside startEvent Listener get process Historic Instance. As i understood it doesn't insert in historic table until Process instances completes. historicProcessInstance  returns null.


ExecutionEntity executionEntity = (ExecutionEntity) execution;
      ExecutionEntity processInstance = executionEntity.getProcessInstance();
      ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
      HistoryService historyService = processEngine.getHistoryService();
      String processInstanceId = processInstance.getProcessInstanceId();      
      HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
2 REPLIES 2

yerbol777
Champ in-the-making
Champ in-the-making
I need these informations during startEvent:
historicProcessInstance.getStartUserId();
historicProcessInstance.getStartTime()

this informations are not available in processInstance.

jbarrez
Star Contributor
Star Contributor
> i understood it doesn't insert in historic table until Process instances completes

That's correct

> this informations are not available in processInstance.

Correct. This will be fixed in v6