use of org.camunda.bpm.engine.rest.dto.history.HistoricCaseInstanceDto in project camunda-bpm-platform by camunda.
the class HistoricCaseInstanceRestServiceImpl method queryHistoricCaseInstances.
public List<HistoricCaseInstanceDto> queryHistoricCaseInstances(HistoricCaseInstanceQueryDto queryDto, Integer firstResult, Integer maxResults) {
HistoricCaseInstanceQuery query = queryDto.toQuery(processEngine);
List<HistoricCaseInstance> matchingHistoricCaseInstances;
if (firstResult != null || maxResults != null) {
matchingHistoricCaseInstances = executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingHistoricCaseInstances = query.list();
}
List<HistoricCaseInstanceDto> historicCaseInstanceDtoResults = new ArrayList<HistoricCaseInstanceDto>();
for (HistoricCaseInstance historicCaseInstance : matchingHistoricCaseInstances) {
HistoricCaseInstanceDto resultHistoricCaseInstanceDto = HistoricCaseInstanceDto.fromHistoricCaseInstance(historicCaseInstance);
historicCaseInstanceDtoResults.add(resultHistoricCaseInstanceDto);
}
return historicCaseInstanceDtoResults;
}
Aggregations