use of org.camunda.bpm.engine.rest.dto.history.batch.HistoricBatchQueryDto in project camunda-bpm-platform by camunda.
the class HistoricBatchRestServiceImpl method getHistoricBatchesCount.
@Override
public CountResultDto getHistoricBatchesCount(UriInfo uriInfo) {
HistoricBatchQueryDto queryDto = new HistoricBatchQueryDto(objectMapper, uriInfo.getQueryParameters());
HistoricBatchQuery query = queryDto.toQuery(processEngine);
long count = query.count();
return new CountResultDto(count);
}
use of org.camunda.bpm.engine.rest.dto.history.batch.HistoricBatchQueryDto in project camunda-bpm-platform by camunda.
the class HistoricBatchRestServiceImpl method getHistoricBatches.
@SuppressWarnings("unchecked")
@Override
public List<HistoricBatchDto> getHistoricBatches(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
HistoricBatchQueryDto queryDto = new HistoricBatchQueryDto(objectMapper, uriInfo.getQueryParameters());
HistoricBatchQuery query = queryDto.toQuery(processEngine);
List<HistoricBatch> matchingBatches;
if (firstResult != null || maxResults != null) {
matchingBatches = (List<HistoricBatch>) executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingBatches = query.list();
}
List<HistoricBatchDto> batchResults = new ArrayList<HistoricBatchDto>();
for (HistoricBatch matchingBatch : matchingBatches) {
batchResults.add(HistoricBatchDto.fromBatch(matchingBatch));
}
return batchResults;
}
Aggregations