use of org.camunda.bpm.engine.rest.dto.repository.ProcessDefinitionQueryDto in project camunda-bpm-platform by camunda.
the class ProcessDefinitionRestServiceImpl method getProcessDefinitionsCount.
@Override
public CountResultDto getProcessDefinitionsCount(UriInfo uriInfo) {
ProcessDefinitionQueryDto queryDto = new ProcessDefinitionQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
ProcessEngine engine = getProcessEngine();
ProcessDefinitionQuery query = queryDto.toQuery(engine);
long count = query.count();
CountResultDto result = new CountResultDto();
result.setCount(count);
return result;
}
use of org.camunda.bpm.engine.rest.dto.repository.ProcessDefinitionQueryDto in project camunda-bpm-platform by camunda.
the class ProcessDefinitionRestServiceImpl method getProcessDefinitions.
@Override
public List<ProcessDefinitionDto> getProcessDefinitions(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
ProcessDefinitionQueryDto queryDto = new ProcessDefinitionQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
List<ProcessDefinitionDto> definitions = new ArrayList<ProcessDefinitionDto>();
ProcessEngine engine = getProcessEngine();
ProcessDefinitionQuery query = queryDto.toQuery(engine);
List<ProcessDefinition> matchingDefinitions = null;
if (firstResult != null || maxResults != null) {
matchingDefinitions = executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingDefinitions = query.list();
}
for (ProcessDefinition definition : matchingDefinitions) {
ProcessDefinitionDto def = ProcessDefinitionDto.fromProcessDefinition(definition);
definitions.add(def);
}
return definitions;
}
Aggregations