use of org.camunda.bpm.engine.history.HistoricDecisionInstance in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceInputOutputValueTest method decisionInputInstanceValue.
@Test
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN })
public void decisionInputInstanceValue() {
startProcessInstanceAndEvaluateDecision(inputValue);
HistoricDecisionInstance historicDecisionInstance = engineRule.getHistoryService().createHistoricDecisionInstanceQuery().includeInputs().singleResult();
List<HistoricDecisionInputInstance> inputInstances = historicDecisionInstance.getInputs();
assertThat(inputInstances.size(), is(1));
HistoricDecisionInputInstance inputInstance = inputInstances.get(0);
assertThat(inputInstance.getTypeName(), is(valueType));
assertThat(inputInstance.getValue(), is(inputValue));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstance in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceInputOutputValueTest method decisionOutputInstanceValue.
@Test
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN })
public void decisionOutputInstanceValue() {
startProcessInstanceAndEvaluateDecision(inputValue);
HistoricDecisionInstance historicDecisionInstance = engineRule.getHistoryService().createHistoricDecisionInstanceQuery().includeOutputs().singleResult();
List<HistoricDecisionOutputInstance> outputInstances = historicDecisionInstance.getOutputs();
assertThat(outputInstances.size(), is(1));
HistoricDecisionOutputInstance outputInstance = outputInstances.get(0);
assertThat(outputInstance.getTypeName(), is(valueType));
assertThat(outputInstance.getValue(), is(inputValue));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstance in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceTest method testCollectResultValue.
@Deployment(resources = { DECISION_PROCESS, DECISION_COLLECT_SUM_DMN })
public void testCollectResultValue() {
startProcessInstanceAndEvaluateDecision();
HistoricDecisionInstance historicDecisionInstance = historyService.createHistoricDecisionInstanceQuery().singleResult();
assertThat(historicDecisionInstance.getCollectResultValue(), is(notNullValue()));
assertThat(historicDecisionInstance.getCollectResultValue(), is(3.0));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstance in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceTest method testDecisionInputInstanceProperties.
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN })
public void testDecisionInputInstanceProperties() {
startProcessInstanceAndEvaluateDecision();
HistoricDecisionInstance historicDecisionInstance = historyService.createHistoricDecisionInstanceQuery().includeInputs().singleResult();
List<HistoricDecisionInputInstance> inputs = historicDecisionInstance.getInputs();
assertThat(inputs, is(notNullValue()));
assertThat(inputs.size(), is(1));
HistoricDecisionInputInstance input = inputs.get(0);
assertThat(input.getDecisionInstanceId(), is(historicDecisionInstance.getId()));
assertThat(input.getClauseId(), is("in"));
assertThat(input.getClauseName(), is("input"));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInstance in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceTest method testDecisionEvaluatedWithAuthenticatedUser.
@Deployment(resources = { DECISION_SINGLE_OUTPUT_DMN })
public void testDecisionEvaluatedWithAuthenticatedUser() {
identityService.setAuthenticatedUserId("demo");
VariableMap variables = Variables.putValue("input1", "test");
decisionService.evaluateDecisionTableByKey(DECISION_DEFINITION_KEY, variables);
HistoricDecisionInstance historicDecisionInstance = historyService.createHistoricDecisionInstanceQuery().singleResult();
assertThat(historicDecisionInstance, is(notNullValue()));
// the user should be set since the decision was evaluated with the decision service
assertThat(historicDecisionInstance.getUserId(), is("demo"));
}
Aggregations