Search in sources :

Example 1 with HistoricCaseActivityInstanceDto

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

the class HistoricCaseActivityInstanceRestServiceImpl method queryHistoricCaseActivityInstances.

public List<HistoricCaseActivityInstanceDto> queryHistoricCaseActivityInstances(HistoricCaseActivityInstanceQueryDto queryDto, Integer firstResult, Integer maxResults) {
    HistoricCaseActivityInstanceQuery query = queryDto.toQuery(processEngine);
    List<HistoricCaseActivityInstance> matchingHistoricCaseActivityInstances;
    if (firstResult != null || maxResults != null) {
        matchingHistoricCaseActivityInstances = executePaginatedQuery(query, firstResult, maxResults);
    } else {
        matchingHistoricCaseActivityInstances = query.list();
    }
    List<HistoricCaseActivityInstanceDto> historicCaseActivityInstanceResults = new ArrayList<HistoricCaseActivityInstanceDto>();
    for (HistoricCaseActivityInstance historicCaseActivityInstance : matchingHistoricCaseActivityInstances) {
        HistoricCaseActivityInstanceDto resultHistoricCaseActivityInstance = HistoricCaseActivityInstanceDto.fromHistoricCaseActivityInstance(historicCaseActivityInstance);
        historicCaseActivityInstanceResults.add(resultHistoricCaseActivityInstance);
    }
    return historicCaseActivityInstanceResults;
}
Also used : HistoricCaseActivityInstanceDto(org.camunda.bpm.engine.rest.dto.history.HistoricCaseActivityInstanceDto) ArrayList(java.util.ArrayList) HistoricCaseActivityInstance(org.camunda.bpm.engine.history.HistoricCaseActivityInstance) HistoricCaseActivityInstanceQuery(org.camunda.bpm.engine.history.HistoricCaseActivityInstanceQuery)

Aggregations

ArrayList (java.util.ArrayList)1 HistoricCaseActivityInstance (org.camunda.bpm.engine.history.HistoricCaseActivityInstance)1 HistoricCaseActivityInstanceQuery (org.camunda.bpm.engine.history.HistoricCaseActivityInstanceQuery)1 HistoricCaseActivityInstanceDto (org.camunda.bpm.engine.rest.dto.history.HistoricCaseActivityInstanceDto)1