AnsweredAssumed Answered

HistoricProcessInstance inside ExecutionListener

Question asked by yerbol777 on Jul 29, 2016
Latest reply on Jul 29, 2016 by jbarrez
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();

Outcomes