Search in sources :

Example 1 with HistoricVariableInstanceDto

use of org.camunda.bpm.engine.rest.dto.history.HistoricVariableInstanceDto in project camunda-bpm-platform by camunda.

the class HistoricVariableInstanceRestServiceImpl method queryHistoricVariableInstances.

@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);
        historicVariableInstanceDtoResults.add(resultHistoricVariableInstance);
    }
    return historicVariableInstanceDtoResults;
}
Also used : HistoricVariableInstanceDto(org.camunda.bpm.engine.rest.dto.history.HistoricVariableInstanceDto) HistoricVariableInstanceQuery(org.camunda.bpm.engine.history.HistoricVariableInstanceQuery) ArrayList(java.util.ArrayList) HistoricVariableInstance(org.camunda.bpm.engine.history.HistoricVariableInstance)

Aggregations

ArrayList (java.util.ArrayList)1 HistoricVariableInstance (org.camunda.bpm.engine.history.HistoricVariableInstance)1 HistoricVariableInstanceQuery (org.camunda.bpm.engine.history.HistoricVariableInstanceQuery)1 HistoricVariableInstanceDto (org.camunda.bpm.engine.rest.dto.history.HistoricVariableInstanceDto)1