Trying to get processInstance (completed/in process instances) details based on the BusinessKey. I have tried using below code but it only gets completed process, not the In-Progress instances.
I could achieve the use case using following 2 API. Is there a single API method that can give both data.
// Get completed process instances from History.
List historyIns = historyService.createHistoricProcessInstanceQuery().tenantIdIn("")
.processInstanceBusinessKey(businessKey).list();
// Get active process instances
List<ProcessInstance> activeIns = runtimeService.createProcessInstanceQuery().tenantIdIn("").processInstanceBusinessKey(businessKey).list();