public virtual CountResultDto getBatchesCount(UriInfo uriInfo) { ProcessEngine processEngine = ProcessEngine; BatchQueryDto queryDto = new BatchQueryDto(ObjectMapper, uriInfo.QueryParameters); BatchQuery query = queryDto.toQuery(processEngine); long count = query.count(); return(new CountResultDto(count)); }
public virtual IList <BatchDto> getBatches(UriInfo uriInfo, int?firstResult, int?maxResults) { BatchQueryDto queryDto = new BatchQueryDto(ObjectMapper, uriInfo.QueryParameters); BatchQuery query = queryDto.toQuery(ProcessEngine); IList <Batch> matchingBatches; if (firstResult != null || maxResults != null) { matchingBatches = executePaginatedQuery(query, firstResult, maxResults); } else { matchingBatches = query.list(); } IList <BatchDto> batchResults = new List <BatchDto>(); foreach (Batch matchingBatch in matchingBatches) { batchResults.Add(BatchDto.fromBatch(matchingBatch)); } return(batchResults); }