04-28-2017 11:59 AM
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
04-28-2017 05:12 PM
runtimeService may not give what you want.
The following should work.
historyService().createHistoricProcessInstanceQuery().processDefinitionKey("myKey").unfinished().orderByProcessInstanceStartTime().desc().singleResult()
04-28-2017 05:12 PM
runtimeService may not give what you want.
The following should work.
historyService().createHistoricProcessInstanceQuery().processDefinitionKey("myKey").unfinished().orderByProcessInstanceStartTime().desc().singleResult()
Explore our Alfresco products with the links below. Use labels to filter content by product module.