@Override
public List<HistoricVariableInstanceDto> queryHistoricVariableInstances(HistoricVariableInstanceQueryDto queryDto,
Integer firstResult, Integer maxResults, boolean deserializeObjectValues) {
queryDto.setObjectMapper(objectMapper);
HistoricVariableInstanceQuery query = queryDto.toQuery(processEngine);
query.disableBinaryFetching();
if (!deserializeObjectValues) {
query.disableCustomObjectDeserialization();
}
List<HistoricVariableInstance> matchingHistoricVariableInstances;
if (firstResult != null || maxResults != null) {
matchingHistoricVariableInstances = executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingHistoricVariableInstances = query.list();
}
List<HistoricVariableInstanceDto> historicVariableInstanceDtoResults = new ArrayList<HistoricVariableInstanceDto>();
for (HistoricVariableInstance historicVariableInstance : matchingHistoricVariableInstances) {
HistoricVariableInstanceDto resultHistoricVariableInstance = HistoricVariableInstanceDto.fromHistoricVariableInstance(historicVariableInstance);