use of org.camunda.bpm.engine.rest.dto.repository.CaseDefinitionQueryDto in project camunda-bpm-platform by camunda.
the class CaseDefinitionRestServiceImpl method getCaseDefinitionsCount.
@Override
public CountResultDto getCaseDefinitionsCount(UriInfo uriInfo) {
CaseDefinitionQueryDto queryDto = new CaseDefinitionQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
ProcessEngine engine = getProcessEngine();
CaseDefinitionQuery 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.CaseDefinitionQueryDto in project camunda-bpm-platform by camunda.
the class CaseDefinitionRestServiceImpl method getCaseDefinitions.
@Override
public List<CaseDefinitionDto> getCaseDefinitions(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
CaseDefinitionQueryDto queryDto = new CaseDefinitionQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
List<CaseDefinitionDto> definitions = new ArrayList<CaseDefinitionDto>();
ProcessEngine engine = getProcessEngine();
CaseDefinitionQuery query = queryDto.toQuery(engine);
List<CaseDefinition> matchingDefinitions = null;
if (firstResult != null || maxResults != null) {
matchingDefinitions = executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingDefinitions = query.list();
}
for (CaseDefinition definition : matchingDefinitions) {
CaseDefinitionDto def = CaseDefinitionDto.fromCaseDefinition(definition);
definitions.add(def);
}
return definitions;
}
Aggregations