Search in sources :

Example 1 with HistoricIncidentDto

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

the class HistoricIncidentRestServiceImpl method getHistoricIncidents.

@Override
public List<HistoricIncidentDto> getHistoricIncidents(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
    HistoricIncidentQueryDto queryDto = new HistoricIncidentQueryDto(objectMapper, uriInfo.getQueryParameters());
    HistoricIncidentQuery query = queryDto.toQuery(processEngine);
    List<HistoricIncident> queryResult;
    if (firstResult != null || maxResults != null) {
        queryResult = executePaginatedQuery(query, firstResult, maxResults);
    } else {
        queryResult = query.list();
    }
    List<HistoricIncidentDto> result = new ArrayList<HistoricIncidentDto>();
    for (HistoricIncident historicIncident : queryResult) {
        HistoricIncidentDto dto = HistoricIncidentDto.fromHistoricIncident(historicIncident);
        result.add(dto);
    }
    return result;
}
Also used : HistoricIncident(org.camunda.bpm.engine.history.HistoricIncident) HistoricIncidentQueryDto(org.camunda.bpm.engine.rest.dto.history.HistoricIncidentQueryDto) ArrayList(java.util.ArrayList) HistoricIncidentDto(org.camunda.bpm.engine.rest.dto.history.HistoricIncidentDto) HistoricIncidentQuery(org.camunda.bpm.engine.history.HistoricIncidentQuery)

Aggregations

ArrayList (java.util.ArrayList)1 HistoricIncident (org.camunda.bpm.engine.history.HistoricIncident)1 HistoricIncidentQuery (org.camunda.bpm.engine.history.HistoricIncidentQuery)1 HistoricIncidentDto (org.camunda.bpm.engine.rest.dto.history.HistoricIncidentDto)1 HistoricIncidentQueryDto (org.camunda.bpm.engine.rest.dto.history.HistoricIncidentQueryDto)1