use of org.camunda.bpm.engine.rest.dto.runtime.CaseExecutionDto in project camunda-bpm-platform by camunda.
the class CaseExecutionRestServiceImpl method queryCaseExecutions.
public List<CaseExecutionDto> queryCaseExecutions(CaseExecutionQueryDto queryDto, Integer firstResult, Integer maxResults) {
ProcessEngine engine = getProcessEngine();
queryDto.setObjectMapper(getObjectMapper());
CaseExecutionQuery query = queryDto.toQuery(engine);
List<CaseExecution> matchingExecutions;
if (firstResult != null || maxResults != null) {
matchingExecutions = executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingExecutions = query.list();
}
List<CaseExecutionDto> executionResults = new ArrayList<CaseExecutionDto>();
for (CaseExecution execution : matchingExecutions) {
CaseExecutionDto resultExecution = CaseExecutionDto.fromCaseExecution(execution);
executionResults.add(resultExecution);
}
return executionResults;
}
use of org.camunda.bpm.engine.rest.dto.runtime.CaseExecutionDto in project camunda-bpm-platform by camunda.
the class CaseExecutionResourceImpl method getCaseExecution.
public CaseExecutionDto getCaseExecution() {
CaseService caseService = engine.getCaseService();
CaseExecution execution = caseService.createCaseExecutionQuery().caseExecutionId(caseExecutionId).singleResult();
if (execution == null) {
throw new InvalidRequestException(Status.NOT_FOUND, "Case execution with id " + caseExecutionId + " does not exist.");
}
CaseExecutionDto result = CaseExecutionDto.fromCaseExecution(execution);
return result;
}
Aggregations