Search in sources :

Example 1 with HistoricDetailQueryDto

use of org.camunda.bpm.engine.rest.dto.history.HistoricDetailQueryDto in project camunda-bpm-platform by camunda.

the class HistoricDetailRestServiceImpl method getHistoricDetailsCount.

@Override
public CountResultDto getHistoricDetailsCount(UriInfo uriInfo) {
    HistoricDetailQueryDto queryDto = new HistoricDetailQueryDto(objectMapper, uriInfo.getQueryParameters());
    HistoricDetailQuery query = queryDto.toQuery(processEngine);
    long count = query.count();
    CountResultDto result = new CountResultDto();
    result.setCount(count);
    return result;
}
Also used : HistoricDetailQueryDto(org.camunda.bpm.engine.rest.dto.history.HistoricDetailQueryDto) CountResultDto(org.camunda.bpm.engine.rest.dto.CountResultDto) HistoricDetailQuery(org.camunda.bpm.engine.history.HistoricDetailQuery)

Example 2 with HistoricDetailQueryDto

use of org.camunda.bpm.engine.rest.dto.history.HistoricDetailQueryDto in project camunda-bpm-platform by camunda.

the class HistoricDetailRestServiceImpl method getHistoricDetails.

@Override
public List<HistoricDetailDto> getHistoricDetails(UriInfo uriInfo, Integer firstResult, Integer maxResults, boolean deserializeObjectValues) {
    HistoricDetailQueryDto queryDto = new HistoricDetailQueryDto(objectMapper, uriInfo.getQueryParameters());
    HistoricDetailQuery query = queryDto.toQuery(processEngine);
    query.disableBinaryFetching();
    if (!deserializeObjectValues) {
        query.disableCustomObjectDeserialization();
    }
    List<HistoricDetail> queryResult;
    if (firstResult != null || maxResults != null) {
        queryResult = executePaginatedQuery(query, firstResult, maxResults);
    } else {
        queryResult = query.list();
    }
    List<HistoricDetailDto> result = new ArrayList<HistoricDetailDto>();
    for (HistoricDetail historicDetail : queryResult) {
        HistoricDetailDto dto = HistoricDetailDto.fromHistoricDetail(historicDetail);
        result.add(dto);
    }
    return result;
}
Also used : HistoricDetail(org.camunda.bpm.engine.history.HistoricDetail) HistoricDetailQueryDto(org.camunda.bpm.engine.rest.dto.history.HistoricDetailQueryDto) ArrayList(java.util.ArrayList) HistoricDetailQuery(org.camunda.bpm.engine.history.HistoricDetailQuery) HistoricDetailDto(org.camunda.bpm.engine.rest.dto.history.HistoricDetailDto)

Aggregations

HistoricDetailQuery (org.camunda.bpm.engine.history.HistoricDetailQuery)2 HistoricDetailQueryDto (org.camunda.bpm.engine.rest.dto.history.HistoricDetailQueryDto)2 ArrayList (java.util.ArrayList)1 HistoricDetail (org.camunda.bpm.engine.history.HistoricDetail)1 CountResultDto (org.camunda.bpm.engine.rest.dto.CountResultDto)1 HistoricDetailDto (org.camunda.bpm.engine.rest.dto.history.HistoricDetailDto)1