use of org.camunda.bpm.engine.rest.dto.history.HistoricActivityInstanceDto in project camunda-bpm-platform by camunda.
the class HistoricActivityInstanceRestServiceImpl method queryHistoricActivityInstances.
@Override
public List<HistoricActivityInstanceDto> queryHistoricActivityInstances(HistoricActivityInstanceQueryDto queryDto, Integer firstResult, Integer maxResults) {
queryDto.setObjectMapper(objectMapper);
HistoricActivityInstanceQuery query = queryDto.toQuery(processEngine);
List<HistoricActivityInstance> matchingHistoricActivityInstances;
if (firstResult != null || maxResults != null) {
matchingHistoricActivityInstances = executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingHistoricActivityInstances = query.list();
}
List<HistoricActivityInstanceDto> historicActivityInstanceResults = new ArrayList<HistoricActivityInstanceDto>();
for (HistoricActivityInstance historicActivityInstance : matchingHistoricActivityInstances) {
HistoricActivityInstanceDto resultHistoricActivityInstance = HistoricActivityInstanceDto.fromHistoricActivityInstance(historicActivityInstance);
historicActivityInstanceResults.add(resultHistoricActivityInstance);
}
return historicActivityInstanceResults;
}
Aggregations