Search in sources :

Example 1 with CaseDefinitionDto

use of org.camunda.bpm.engine.rest.dto.repository.CaseDefinitionDto 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;
}
Also used : CaseDefinitionQueryDto(org.camunda.bpm.engine.rest.dto.repository.CaseDefinitionQueryDto) CaseDefinition(org.camunda.bpm.engine.repository.CaseDefinition) ArrayList(java.util.ArrayList) CaseDefinitionDto(org.camunda.bpm.engine.rest.dto.repository.CaseDefinitionDto) ProcessEngine(org.camunda.bpm.engine.ProcessEngine) CaseDefinitionQuery(org.camunda.bpm.engine.repository.CaseDefinitionQuery)

Aggregations

ArrayList (java.util.ArrayList)1 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)1 CaseDefinition (org.camunda.bpm.engine.repository.CaseDefinition)1 CaseDefinitionQuery (org.camunda.bpm.engine.repository.CaseDefinitionQuery)1 CaseDefinitionDto (org.camunda.bpm.engine.rest.dto.repository.CaseDefinitionDto)1 CaseDefinitionQueryDto (org.camunda.bpm.engine.rest.dto.repository.CaseDefinitionQueryDto)1