Search in sources :

Example 1 with BatchStatisticsQueryDto

use of org.camunda.bpm.engine.rest.dto.batch.BatchStatisticsQueryDto in project camunda-bpm-platform by camunda.

the class BatchRestServiceImpl method getStatistics.

public List<BatchStatisticsDto> getStatistics(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
    BatchStatisticsQueryDto queryDto = new BatchStatisticsQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
    BatchStatisticsQuery query = queryDto.toQuery(getProcessEngine());
    List<BatchStatistics> batchStatisticsList;
    if (firstResult != null || maxResults != null) {
        batchStatisticsList = executePaginatedStatisticsQuery(query, firstResult, maxResults);
    } else {
        batchStatisticsList = query.list();
    }
    List<BatchStatisticsDto> statisticsResults = new ArrayList<BatchStatisticsDto>();
    for (BatchStatistics batchStatistics : batchStatisticsList) {
        statisticsResults.add(BatchStatisticsDto.fromBatchStatistics(batchStatistics));
    }
    return statisticsResults;
}
Also used : BatchStatisticsQuery(org.camunda.bpm.engine.batch.BatchStatisticsQuery) BatchStatisticsQueryDto(org.camunda.bpm.engine.rest.dto.batch.BatchStatisticsQueryDto) ArrayList(java.util.ArrayList) BatchStatisticsDto(org.camunda.bpm.engine.rest.dto.batch.BatchStatisticsDto) BatchStatistics(org.camunda.bpm.engine.batch.BatchStatistics)

Example 2 with BatchStatisticsQueryDto

use of org.camunda.bpm.engine.rest.dto.batch.BatchStatisticsQueryDto in project camunda-bpm-platform by camunda.

the class BatchRestServiceImpl method getStatisticsCount.

public CountResultDto getStatisticsCount(UriInfo uriInfo) {
    BatchStatisticsQueryDto queryDto = new BatchStatisticsQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
    BatchStatisticsQuery query = queryDto.toQuery(getProcessEngine());
    long count = query.count();
    return new CountResultDto(count);
}
Also used : BatchStatisticsQuery(org.camunda.bpm.engine.batch.BatchStatisticsQuery) CountResultDto(org.camunda.bpm.engine.rest.dto.CountResultDto) BatchStatisticsQueryDto(org.camunda.bpm.engine.rest.dto.batch.BatchStatisticsQueryDto)

Aggregations

BatchStatisticsQuery (org.camunda.bpm.engine.batch.BatchStatisticsQuery)2 BatchStatisticsQueryDto (org.camunda.bpm.engine.rest.dto.batch.BatchStatisticsQueryDto)2 ArrayList (java.util.ArrayList)1 BatchStatistics (org.camunda.bpm.engine.batch.BatchStatistics)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 BatchStatisticsDto (org.camunda.bpm.engine.rest.dto.batch.BatchStatisticsDto)1