Search in sources :

Example 1 with IncidentDto

use of org.camunda.bpm.engine.rest.dto.runtime.IncidentDto in project camunda-bpm-platform by camunda.

the class IncidentRestServiceImpl method getIncidents.

@Override
public List<IncidentDto> getIncidents(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
    IncidentQueryDto queryDto = new IncidentQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
    IncidentQuery query = queryDto.toQuery(processEngine);
    List<Incident> queryResult;
    if (firstResult != null || maxResults != null) {
        queryResult = executePaginatedQuery(query, firstResult, maxResults);
    } else {
        queryResult = query.list();
    }
    List<IncidentDto> result = new ArrayList<IncidentDto>();
    for (Incident incident : queryResult) {
        IncidentDto dto = IncidentDto.fromIncident(incident);
        result.add(dto);
    }
    return result;
}
Also used : IncidentQuery(org.camunda.bpm.engine.runtime.IncidentQuery) ArrayList(java.util.ArrayList) IncidentDto(org.camunda.bpm.engine.rest.dto.runtime.IncidentDto) IncidentQueryDto(org.camunda.bpm.engine.rest.dto.runtime.IncidentQueryDto) Incident(org.camunda.bpm.engine.runtime.Incident)

Aggregations

ArrayList (java.util.ArrayList)1 IncidentDto (org.camunda.bpm.engine.rest.dto.runtime.IncidentDto)1 IncidentQueryDto (org.camunda.bpm.engine.rest.dto.runtime.IncidentQueryDto)1 Incident (org.camunda.bpm.engine.runtime.Incident)1 IncidentQuery (org.camunda.bpm.engine.runtime.IncidentQuery)1