public virtual IList <JobDto> queryJobs(JobQueryDto queryDto, int?firstResult, int?maxResults) { ProcessEngine engine = ProcessEngine; queryDto.ObjectMapper = ObjectMapper; JobQuery query = queryDto.toQuery(engine); IList <Job> matchingJobs; if (firstResult != null || maxResults != null) { matchingJobs = executePaginatedQuery(query, firstResult, maxResults); } else { matchingJobs = query.list(); } IList <JobDto> jobResults = new List <JobDto>(); foreach (Job job in matchingJobs) { JobDto resultJob = JobDto.fromJob(job); jobResults.Add(resultJob); } return(jobResults); }
public virtual CountResultDto queryJobsCount(JobQueryDto queryDto) { ProcessEngine engine = ProcessEngine; queryDto.ObjectMapper = ObjectMapper; JobQuery query = queryDto.toQuery(engine); long count = query.count(); CountResultDto result = new CountResultDto(); result.Count = count; return(result); }