Search in sources :

Example 1 with HistoricBatchQueryDto

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);
}
Also used : HistoricBatchQueryDto(org.camunda.bpm.engine.rest.dto.history.batch.HistoricBatchQueryDto) CountResultDto(org.camunda.bpm.engine.rest.dto.CountResultDto) HistoricBatchQuery(org.camunda.bpm.engine.batch.history.HistoricBatchQuery)

Example 2 with HistoricBatchQueryDto

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;
}
Also used : HistoricBatch(org.camunda.bpm.engine.batch.history.HistoricBatch) HistoricBatchQueryDto(org.camunda.bpm.engine.rest.dto.history.batch.HistoricBatchQueryDto) HistoricBatchQuery(org.camunda.bpm.engine.batch.history.HistoricBatchQuery) ArrayList(java.util.ArrayList) HistoricBatchDto(org.camunda.bpm.engine.rest.dto.history.batch.HistoricBatchDto)

Aggregations

HistoricBatchQuery (org.camunda.bpm.engine.batch.history.HistoricBatchQuery)2 HistoricBatchQueryDto (org.camunda.bpm.engine.rest.dto.history.batch.HistoricBatchQueryDto)2 ArrayList (java.util.ArrayList)1 HistoricBatch (org.camunda.bpm.engine.batch.history.HistoricBatch)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 HistoricBatchDto (org.camunda.bpm.engine.rest.dto.history.batch.HistoricBatchDto)1