Search in sources :

Example 1 with HistoricDecisionInstanceDto

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

the class HistoricDecisionInstanceRestServiceImpl method queryHistoricDecisionInstances.

public List<HistoricDecisionInstanceDto> queryHistoricDecisionInstances(HistoricDecisionInstanceQueryDto queryDto, Integer firstResult, Integer maxResults) {
    HistoricDecisionInstanceQuery query = queryDto.toQuery(processEngine);
    List<HistoricDecisionInstance> matchingHistoricDecisionInstances;
    if (firstResult != null || maxResults != null) {
        matchingHistoricDecisionInstances = executePaginatedQuery(query, firstResult, maxResults);
    } else {
        matchingHistoricDecisionInstances = query.list();
    }
    List<HistoricDecisionInstanceDto> historicDecisionInstanceDtoResults = new ArrayList<HistoricDecisionInstanceDto>();
    for (HistoricDecisionInstance historicDecisionInstance : matchingHistoricDecisionInstances) {
        HistoricDecisionInstanceDto resultHistoricDecisionInstanceDto = HistoricDecisionInstanceDto.fromHistoricDecisionInstance(historicDecisionInstance);
        historicDecisionInstanceDtoResults.add(resultHistoricDecisionInstanceDto);
    }
    return historicDecisionInstanceDtoResults;
}
Also used : HistoricDecisionInstanceDto(org.camunda.bpm.engine.rest.dto.history.HistoricDecisionInstanceDto) ArrayList(java.util.ArrayList) HistoricDecisionInstance(org.camunda.bpm.engine.history.HistoricDecisionInstance) HistoricDecisionInstanceQuery(org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery)

Aggregations

ArrayList (java.util.ArrayList)1 HistoricDecisionInstance (org.camunda.bpm.engine.history.HistoricDecisionInstance)1 HistoricDecisionInstanceQuery (org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery)1 HistoricDecisionInstanceDto (org.camunda.bpm.engine.rest.dto.history.HistoricDecisionInstanceDto)1