Search in sources :

Example 1 with HistoricTaskInstanceDto

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

the class HistoricTaskInstanceRestServiceImpl method queryHistoricTaskInstances.

@Override
public List<HistoricTaskInstanceDto> queryHistoricTaskInstances(HistoricTaskInstanceQueryDto queryDto, Integer firstResult, Integer maxResults) {
    queryDto.setObjectMapper(objectMapper);
    HistoricTaskInstanceQuery query = queryDto.toQuery(processEngine);
    List<HistoricTaskInstance> match;
    if (firstResult != null || maxResults != null) {
        match = executePaginatedQuery(query, firstResult, maxResults);
    } else {
        match = query.list();
    }
    List<HistoricTaskInstanceDto> result = new ArrayList<HistoricTaskInstanceDto>();
    for (HistoricTaskInstance taskInstance : match) {
        HistoricTaskInstanceDto taskInstanceDto = HistoricTaskInstanceDto.fromHistoricTaskInstance(taskInstance);
        result.add(taskInstanceDto);
    }
    return result;
}
Also used : HistoricTaskInstanceDto(org.camunda.bpm.engine.rest.dto.history.HistoricTaskInstanceDto) HistoricTaskInstance(org.camunda.bpm.engine.history.HistoricTaskInstance) ArrayList(java.util.ArrayList) HistoricTaskInstanceQuery(org.camunda.bpm.engine.history.HistoricTaskInstanceQuery)

Aggregations

ArrayList (java.util.ArrayList)1 HistoricTaskInstance (org.camunda.bpm.engine.history.HistoricTaskInstance)1 HistoricTaskInstanceQuery (org.camunda.bpm.engine.history.HistoricTaskInstanceQuery)1 HistoricTaskInstanceDto (org.camunda.bpm.engine.rest.dto.history.HistoricTaskInstanceDto)1