Hello everyone,
Is it possible to get the latest running process in Activiti with createProcessInstanceQuery ?
runtimeService.createProcessInstanceQuery().processDefinitionKey('myKey').active().singleResult().getProcessInstanceId() I want to get the process instance ID of that definition but only the latest running process.
Thank you
Solved! Go to Solution.
runtimeService may not give what you want.
The following should work.
historyService().createHistoricProcessInstanceQuery().processDefinitionKey("myKey").unfinished().orderByProcessInstanceStartTime().desc().singleResult()
runtimeService may not give what you want.
The following should work.
historyService().createHistoricProcessInstanceQuery().processDefinitionKey("myKey").unfinished().orderByProcessInstanceStartTime().desc().singleResult()
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.