Search in sources :

Example 1 with DecisionDefinitionDto

use of org.camunda.bpm.engine.rest.dto.repository.DecisionDefinitionDto in project camunda-bpm-platform by camunda.

the class DecisionDefinitionRestServiceImpl method getDecisionDefinitions.

@Override
public List<DecisionDefinitionDto> getDecisionDefinitions(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
    DecisionDefinitionQueryDto queryDto = new DecisionDefinitionQueryDto(getObjectMapper(), uriInfo.getQueryParameters());
    List<DecisionDefinitionDto> definitions = new ArrayList<DecisionDefinitionDto>();
    ProcessEngine engine = getProcessEngine();
    DecisionDefinitionQuery query = queryDto.toQuery(engine);
    List<DecisionDefinition> matchingDefinitions = null;
    if (firstResult != null || maxResults != null) {
        matchingDefinitions = executePaginatedQuery(query, firstResult, maxResults);
    } else {
        matchingDefinitions = query.list();
    }
    for (DecisionDefinition definition : matchingDefinitions) {
        DecisionDefinitionDto def = DecisionDefinitionDto.fromDecisionDefinition(definition);
        definitions.add(def);
    }
    return definitions;
}
Also used : DecisionDefinitionQueryDto(org.camunda.bpm.engine.rest.dto.repository.DecisionDefinitionQueryDto) DecisionDefinitionQuery(org.camunda.bpm.engine.repository.DecisionDefinitionQuery) ArrayList(java.util.ArrayList) DecisionDefinitionDto(org.camunda.bpm.engine.rest.dto.repository.DecisionDefinitionDto) DecisionDefinition(org.camunda.bpm.engine.repository.DecisionDefinition) ProcessEngine(org.camunda.bpm.engine.ProcessEngine)

Aggregations

ArrayList (java.util.ArrayList)1 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)1 DecisionDefinition (org.camunda.bpm.engine.repository.DecisionDefinition)1 DecisionDefinitionQuery (org.camunda.bpm.engine.repository.DecisionDefinitionQuery)1 DecisionDefinitionDto (org.camunda.bpm.engine.rest.dto.repository.DecisionDefinitionDto)1 DecisionDefinitionQueryDto (org.camunda.bpm.engine.rest.dto.repository.DecisionDefinitionQueryDto)1