use of org.camunda.bpm.engine.rest.dto.runtime.ExecutionDto in project camunda-bpm-platform by camunda.
the class ExecutionRestServiceImpl method queryExecutions.
@Override
public List<ExecutionDto> queryExecutions(ExecutionQueryDto queryDto, Integer firstResult, Integer maxResults) {
ProcessEngine engine = getProcessEngine();
queryDto.setObjectMapper(getObjectMapper());
ExecutionQuery query = queryDto.toQuery(engine);
List<Execution> matchingExecutions;
if (firstResult != null || maxResults != null) {
matchingExecutions = executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingExecutions = query.list();
}
List<ExecutionDto> executionResults = new ArrayList<ExecutionDto>();
for (Execution execution : matchingExecutions) {
ExecutionDto resultExecution = ExecutionDto.fromExecution(execution);
executionResults.add(resultExecution);
}
return executionResults;
}
Aggregations