Search in sources :

Example 1 with HistoricActivityInstanceDto

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

the class HistoricActivityInstanceRestServiceImpl method queryHistoricActivityInstances.

@Override
public List<HistoricActivityInstanceDto> queryHistoricActivityInstances(HistoricActivityInstanceQueryDto queryDto, Integer firstResult, Integer maxResults) {
    queryDto.setObjectMapper(objectMapper);
    HistoricActivityInstanceQuery query = queryDto.toQuery(processEngine);
    List<HistoricActivityInstance> matchingHistoricActivityInstances;
    if (firstResult != null || maxResults != null) {
        matchingHistoricActivityInstances = executePaginatedQuery(query, firstResult, maxResults);
    } else {
        matchingHistoricActivityInstances = query.list();
    }
    List<HistoricActivityInstanceDto> historicActivityInstanceResults = new ArrayList<HistoricActivityInstanceDto>();
    for (HistoricActivityInstance historicActivityInstance : matchingHistoricActivityInstances) {
        HistoricActivityInstanceDto resultHistoricActivityInstance = HistoricActivityInstanceDto.fromHistoricActivityInstance(historicActivityInstance);
        historicActivityInstanceResults.add(resultHistoricActivityInstance);
    }
    return historicActivityInstanceResults;
}
Also used : HistoricActivityInstanceQuery(org.camunda.bpm.engine.history.HistoricActivityInstanceQuery) ArrayList(java.util.ArrayList) HistoricActivityInstanceDto(org.camunda.bpm.engine.rest.dto.history.HistoricActivityInstanceDto) HistoricActivityInstance(org.camunda.bpm.engine.history.HistoricActivityInstance)

Aggregations

ArrayList (java.util.ArrayList)1 HistoricActivityInstance (org.camunda.bpm.engine.history.HistoricActivityInstance)1 HistoricActivityInstanceQuery (org.camunda.bpm.engine.history.HistoricActivityInstanceQuery)1 HistoricActivityInstanceDto (org.camunda.bpm.engine.rest.dto.history.HistoricActivityInstanceDto)1