use of org.camunda.bpm.engine.rest.dto.runtime.JobDto in project camunda-bpm-platform by camunda.
the class JobRestServiceImpl method queryJobs.
@Override
public List<JobDto> queryJobs(JobQueryDto queryDto, Integer firstResult, Integer maxResults) {
ProcessEngine engine = getProcessEngine();
queryDto.setObjectMapper(getObjectMapper());
JobQuery query = queryDto.toQuery(engine);
List<Job> matchingJobs;
if (firstResult != null || maxResults != null) {
matchingJobs = executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingJobs = query.list();
}
List<JobDto> jobResults = new ArrayList<JobDto>();
for (Job job : matchingJobs) {
JobDto resultJob = JobDto.fromJob(job);
jobResults.add(resultJob);
}
return jobResults;
}
Aggregations