use of org.camunda.bpm.engine.rest.dto.batch.BatchQueryDto in project camunda-bpm-platform by camunda.
the class BatchRestServiceImpl method getBatches.
public List<BatchDto> getBatches(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
BatchQueryDto queryDto = new BatchQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
BatchQuery query = queryDto.toQuery(getProcessEngine());
List<Batch> matchingBatches;
if (firstResult != null || maxResults != null) {
matchingBatches = executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingBatches = query.list();
}
List<BatchDto> batchResults = new ArrayList<BatchDto>();
for (Batch matchingBatch : matchingBatches) {
batchResults.add(BatchDto.fromBatch(matchingBatch));
}
return batchResults;
}
use of org.camunda.bpm.engine.rest.dto.batch.BatchQueryDto in project camunda-bpm-platform by camunda.
the class BatchRestServiceImpl method getBatchesCount.
public CountResultDto getBatchesCount(UriInfo uriInfo) {
ProcessEngine processEngine = getProcessEngine();
BatchQueryDto queryDto = new BatchQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
BatchQuery query = queryDto.toQuery(processEngine);
long count = query.count();
return new CountResultDto(count);
}
Aggregations