Search in sources :

Example 1 with VariableInstanceDto

use of org.camunda.bpm.engine.rest.dto.runtime.VariableInstanceDto in project camunda-bpm-platform by camunda.

the class VariableInstanceRestServiceImpl method queryVariableInstances.

@Override
public List<VariableInstanceDto> queryVariableInstances(VariableInstanceQueryDto queryDto, Integer firstResult, Integer maxResults, boolean deserializeObjectValues) {
    ProcessEngine engine = getProcessEngine();
    queryDto.setObjectMapper(getObjectMapper());
    VariableInstanceQuery query = queryDto.toQuery(engine);
    // disable binary fetching by default.
    query.disableBinaryFetching();
    // disable custom object fetching by default. Cannot be done to not break existing API
    if (!deserializeObjectValues) {
        query.disableCustomObjectDeserialization();
    }
    List<VariableInstance> matchingInstances;
    if (firstResult != null || maxResults != null) {
        matchingInstances = executePaginatedQuery(query, firstResult, maxResults);
    } else {
        matchingInstances = query.list();
    }
    List<VariableInstanceDto> instanceResults = new ArrayList<VariableInstanceDto>();
    for (VariableInstance instance : matchingInstances) {
        VariableInstanceDto resultInstance = VariableInstanceDto.fromVariableInstance(instance);
        instanceResults.add(resultInstance);
    }
    return instanceResults;
}
Also used : VariableInstanceQuery(org.camunda.bpm.engine.runtime.VariableInstanceQuery) ArrayList(java.util.ArrayList) VariableInstance(org.camunda.bpm.engine.runtime.VariableInstance) VariableInstanceDto(org.camunda.bpm.engine.rest.dto.runtime.VariableInstanceDto) ProcessEngine(org.camunda.bpm.engine.ProcessEngine)

Aggregations

ArrayList (java.util.ArrayList)1 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)1 VariableInstanceDto (org.camunda.bpm.engine.rest.dto.runtime.VariableInstanceDto)1 VariableInstance (org.camunda.bpm.engine.runtime.VariableInstance)1 VariableInstanceQuery (org.camunda.bpm.engine.runtime.VariableInstanceQuery)1