HistoricProcessInstanceQuery query = ActivitiUtil.getHistoryService().createHistoricProcessInstanceQuery();
query = query.unfinished();
String processDefinitionId = getQuery().getValues("processDefinitionId");
String processInstanceKey = getQuery().getValues("businessKey");
query = processDefinitionId == null ? query : query.processDefinitionId(processDefinitionId);
query = processInstanceKey == null ? query : query.processInstanceBusinessKey(processInstanceKey);
DataResponse response = new ProcessInstancesPaginateList().paginateList(getQuery(), query, "id", properties);
return response;
}
}