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;
}
Aggregations