I’m trying to write a ProcessCompletedListener using flowable events.
Now inside the event, I’m trying to access variables associated with the processInstanceId.
To do that I tried to get the processDefinitionId using runtimeService and historicService. But both of these services are returning null.
// Completed process, returns null; expected process is still running HistoricProcessInstance process = processEngine.getHistoryService().createHistoricProcessInstanceQuery() .processInstanceId(procInstanceId).singleResult(); // Why is runtimeService also returning null ? ProcessInstance processInstance = processEngine.getRuntimeService() .createProcessInstanceQuery() .processInstanceId(procInstanceId) .singleResult();
Getting processDefintionID was the first step in my process to get the variables associated with the processInstance. What service should I query in order to get processInstance variables/other-meta(processDefintionName, deploymentId) etc… inside a flowableEvent onEvent?
I have isFailOnException = true, isFireOnTransactionLifecycleEvent = false, getOnTransaction = null as override values for the event.