Search in sources :

Example 1 with ExecutionDto

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;
}
Also used : Execution(org.camunda.bpm.engine.runtime.Execution) ArrayList(java.util.ArrayList) ExecutionDto(org.camunda.bpm.engine.rest.dto.runtime.ExecutionDto) ExecutionQuery(org.camunda.bpm.engine.runtime.ExecutionQuery) ProcessEngine(org.camunda.bpm.engine.ProcessEngine)

Aggregations

ArrayList (java.util.ArrayList)1 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)1 ExecutionDto (org.camunda.bpm.engine.rest.dto.runtime.ExecutionDto)1 Execution (org.camunda.bpm.engine.runtime.Execution)1 ExecutionQuery (org.camunda.bpm.engine.runtime.ExecutionQuery)1