Search in sources :

Example 1 with JobDefinitionDto

use of org.camunda.bpm.engine.rest.dto.management.JobDefinitionDto in project camunda-bpm-platform by camunda.

the class JobDefinitionRestServiceImpl method queryJobDefinitions.

public List<JobDefinitionDto> queryJobDefinitions(JobDefinitionQueryDto queryDto, Integer firstResult, Integer maxResults) {
    queryDto.setObjectMapper(getObjectMapper());
    JobDefinitionQuery query = queryDto.toQuery(getProcessEngine());
    List<JobDefinition> matchingJobDefinitions;
    if (firstResult != null || maxResults != null) {
        matchingJobDefinitions = executePaginatedQuery(query, firstResult, maxResults);
    } else {
        matchingJobDefinitions = query.list();
    }
    List<JobDefinitionDto> jobDefinitionResults = new ArrayList<JobDefinitionDto>();
    for (JobDefinition jobDefinition : matchingJobDefinitions) {
        JobDefinitionDto result = JobDefinitionDto.fromJobDefinition(jobDefinition);
        jobDefinitionResults.add(result);
    }
    return jobDefinitionResults;
}
Also used : JobDefinitionQuery(org.camunda.bpm.engine.management.JobDefinitionQuery) JobDefinitionDto(org.camunda.bpm.engine.rest.dto.management.JobDefinitionDto) ArrayList(java.util.ArrayList) JobDefinition(org.camunda.bpm.engine.management.JobDefinition)

Aggregations

ArrayList (java.util.ArrayList)1 JobDefinition (org.camunda.bpm.engine.management.JobDefinition)1 JobDefinitionQuery (org.camunda.bpm.engine.management.JobDefinitionQuery)1 JobDefinitionDto (org.camunda.bpm.engine.rest.dto.management.JobDefinitionDto)1