public virtual IList <ExecutionDto> queryExecutions(ExecutionQueryDto queryDto, int?firstResult, int?maxResults) { ProcessEngine engine = ProcessEngine; queryDto.ObjectMapper = ObjectMapper; ExecutionQuery query = queryDto.toQuery(engine); IList <Execution> matchingExecutions; if (firstResult != null || maxResults != null) { matchingExecutions = executePaginatedQuery(query, firstResult, maxResults); } else { matchingExecutions = query.list(); } IList <ExecutionDto> executionResults = new List <ExecutionDto>(); foreach (Execution execution in matchingExecutions) { ExecutionDto resultExecution = ExecutionDto.fromExecution(execution); executionResults.Add(resultExecution); } return(executionResults); }
public virtual CountResultDto queryExecutionsCount(ExecutionQueryDto queryDto) { ProcessEngine engine = ProcessEngine; queryDto.ObjectMapper = ObjectMapper; ExecutionQuery query = queryDto.toQuery(engine); long count = query.count(); CountResultDto result = new CountResultDto(); result.Count = count; return(result); }