Search in sources :

Example 1 with HistoricCaseInstanceDto

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

the class HistoricCaseInstanceRestServiceImpl method queryHistoricCaseInstances.

public List<HistoricCaseInstanceDto> queryHistoricCaseInstances(HistoricCaseInstanceQueryDto queryDto, Integer firstResult, Integer maxResults) {
    HistoricCaseInstanceQuery query = queryDto.toQuery(processEngine);
    List<HistoricCaseInstance> matchingHistoricCaseInstances;
    if (firstResult != null || maxResults != null) {
        matchingHistoricCaseInstances = executePaginatedQuery(query, firstResult, maxResults);
    } else {
        matchingHistoricCaseInstances = query.list();
    }
    List<HistoricCaseInstanceDto> historicCaseInstanceDtoResults = new ArrayList<HistoricCaseInstanceDto>();
    for (HistoricCaseInstance historicCaseInstance : matchingHistoricCaseInstances) {
        HistoricCaseInstanceDto resultHistoricCaseInstanceDto = HistoricCaseInstanceDto.fromHistoricCaseInstance(historicCaseInstance);
        historicCaseInstanceDtoResults.add(resultHistoricCaseInstanceDto);
    }
    return historicCaseInstanceDtoResults;
}
Also used : HistoricCaseInstanceDto(org.camunda.bpm.engine.rest.dto.history.HistoricCaseInstanceDto) HistoricCaseInstance(org.camunda.bpm.engine.history.HistoricCaseInstance) ArrayList(java.util.ArrayList) HistoricCaseInstanceQuery(org.camunda.bpm.engine.history.HistoricCaseInstanceQuery)

Aggregations

ArrayList (java.util.ArrayList)1 HistoricCaseInstance (org.camunda.bpm.engine.history.HistoricCaseInstance)1 HistoricCaseInstanceQuery (org.camunda.bpm.engine.history.HistoricCaseInstanceQuery)1 HistoricCaseInstanceDto (org.camunda.bpm.engine.rest.dto.history.HistoricCaseInstanceDto)1