private boolean isHistoricVariableUpdateForTargetVariable(final String processVariableName, final HistoricVariableUpdate historicVariableUpdate) { return processVariableName.equals(historicVariableUpdate.getVariableName()); }
@Override public void historicProcessVariableLatestValueEquals(final String processInstanceId, final String processVariableName, final Object expectedValue) { // Assert the history level is set to full callback.trace(LogMessage.CONFIGURATION_1, HistoryLevel.FULL.name()); checkHistoryLevelIsFull(); // Assert there is a historic process instance by the provided id callback.trace(LogMessage.PROCESS_13, processInstanceId); final HistoricProcessInstance historicProcessInstance = getHistoryService().createHistoricProcessInstanceQuery().processInstanceId(processInstanceId) .singleResult(); Assert.assertThat(historicProcessInstance, is(notNullValue())); // Assert there is a variable by the provided name callback.trace(LogMessage.VARIABLE_1, processVariableName, processInstanceId); final List<HistoricVariableUpdate> variableUpdates = getDescendingVariableUpdates(processInstanceId, processVariableName); Assert.assertThat(variableUpdates, CoreMatchers.not(IsEmptyCollection.empty())); // Assert the latest value of the variable is equal to the expected value callback.trace(LogMessage.VARIABLE_2, processVariableName, expectedValue); final HistoricVariableUpdate latestValue = variableUpdates.get(0); Assert.assertThat(latestValue.getValue(), is(expectedValue)); }
variableUpdate.getValue();