use of org.camunda.bpm.engine.rest.dto.externaltask.ExternalTaskDto in project camunda-bpm-platform by camunda.
the class ExternalTaskRestServiceImpl method queryExternalTasks.
@Override
public List<ExternalTaskDto> queryExternalTasks(ExternalTaskQueryDto queryDto, Integer firstResult, Integer maxResults) {
ProcessEngine engine = getProcessEngine();
queryDto.setObjectMapper(getObjectMapper());
ExternalTaskQuery query = queryDto.toQuery(engine);
List<ExternalTask> matchingTasks;
if (firstResult != null || maxResults != null) {
matchingTasks = executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingTasks = query.list();
}
List<ExternalTaskDto> taskResults = new ArrayList<ExternalTaskDto>();
for (ExternalTask task : matchingTasks) {
ExternalTaskDto resultInstance = ExternalTaskDto.fromExternalTask(task);
taskResults.add(resultInstance);
}
return taskResults;
}
Aggregations