Search in sources :

Example 1 with HistoricDetailVariableInstanceUpdateEntity

use of org.camunda.bpm.engine.impl.persistence.entity.HistoricDetailVariableInstanceUpdateEntity in project camunda-bpm-platform by camunda.

the class TaskServiceTest method checkHistoricVariableUpdateEntity.

private void checkHistoricVariableUpdateEntity(String variableName, String processInstanceId) {
    if (processEngineConfiguration.getHistoryLevel().getId() == ProcessEngineConfigurationImpl.HISTORYLEVEL_FULL) {
        boolean deletedVariableUpdateFound = false;
        List<HistoricDetail> resultSet = historyService.createHistoricDetailQuery().processInstanceId(processInstanceId).list();
        for (HistoricDetail currentHistoricDetail : resultSet) {
            assertTrue(currentHistoricDetail instanceof HistoricDetailVariableInstanceUpdateEntity);
            HistoricDetailVariableInstanceUpdateEntity historicVariableUpdate = (HistoricDetailVariableInstanceUpdateEntity) currentHistoricDetail;
            if (historicVariableUpdate.getName().equals(variableName)) {
                if (historicVariableUpdate.getValue() == null) {
                    if (deletedVariableUpdateFound) {
                        fail("Mismatch: A HistoricVariableUpdateEntity with a null value already found");
                    } else {
                        deletedVariableUpdateFound = true;
                    }
                }
            }
        }
        assertTrue(deletedVariableUpdateFound);
    }
}
Also used : HistoricDetail(org.camunda.bpm.engine.history.HistoricDetail) HistoricDetailVariableInstanceUpdateEntity(org.camunda.bpm.engine.impl.persistence.entity.HistoricDetailVariableInstanceUpdateEntity)

Example 2 with HistoricDetailVariableInstanceUpdateEntity

use of org.camunda.bpm.engine.impl.persistence.entity.HistoricDetailVariableInstanceUpdateEntity in project camunda-bpm-platform by camunda.

the class HistoricDetailQueryImpl method executeList.

public List<HistoricDetail> executeList(CommandContext commandContext, Page page) {
    checkQueryOk();
    List<HistoricDetail> historicDetails = commandContext.getHistoricDetailManager().findHistoricDetailsByQueryCriteria(this, page);
    if (historicDetails != null) {
        for (HistoricDetail historicDetail : historicDetails) {
            if (historicDetail instanceof HistoricDetailVariableInstanceUpdateEntity) {
                HistoricDetailVariableInstanceUpdateEntity entity = (HistoricDetailVariableInstanceUpdateEntity) historicDetail;
                if (shouldFetchValue(entity)) {
                    try {
                        entity.getTypedValue(isCustomObjectDeserializationEnabled);
                    } catch (Exception t) {
                        // do not fail if one of the variables fails to load
                        LOG.exceptionWhileGettingValueForVariable(t);
                    }
                }
            }
        }
    }
    return historicDetails;
}
Also used : HistoricDetail(org.camunda.bpm.engine.history.HistoricDetail) HistoricDetailVariableInstanceUpdateEntity(org.camunda.bpm.engine.impl.persistence.entity.HistoricDetailVariableInstanceUpdateEntity)

Example 3 with HistoricDetailVariableInstanceUpdateEntity

use of org.camunda.bpm.engine.impl.persistence.entity.HistoricDetailVariableInstanceUpdateEntity in project camunda-bpm-platform by camunda.

the class RuntimeServiceTest method checkHistoricVariableUpdateEntity.

private void checkHistoricVariableUpdateEntity(String variableName, String processInstanceId) {
    if (processEngineConfiguration.getHistoryLevel().equals(HistoryLevel.HISTORY_LEVEL_FULL)) {
        boolean deletedVariableUpdateFound = false;
        List<HistoricDetail> resultSet = historyService.createHistoricDetailQuery().processInstanceId(processInstanceId).list();
        for (HistoricDetail currentHistoricDetail : resultSet) {
            assertTrue(currentHistoricDetail instanceof HistoricDetailVariableInstanceUpdateEntity);
            HistoricDetailVariableInstanceUpdateEntity historicVariableUpdate = (HistoricDetailVariableInstanceUpdateEntity) currentHistoricDetail;
            if (historicVariableUpdate.getName().equals(variableName)) {
                if (historicVariableUpdate.getValue() == null) {
                    if (deletedVariableUpdateFound) {
                        fail("Mismatch: A HistoricVariableUpdateEntity with a null value already found");
                    } else {
                        deletedVariableUpdateFound = true;
                    }
                }
            }
        }
        assertTrue(deletedVariableUpdateFound);
    }
}
Also used : HistoricDetail(org.camunda.bpm.engine.history.HistoricDetail) HistoricDetailVariableInstanceUpdateEntity(org.camunda.bpm.engine.impl.persistence.entity.HistoricDetailVariableInstanceUpdateEntity)

Aggregations

HistoricDetail (org.camunda.bpm.engine.history.HistoricDetail)3 HistoricDetailVariableInstanceUpdateEntity (org.camunda.bpm.engine.impl.persistence.entity.HistoricDetailVariableInstanceUpdateEntity)3