use of org.camunda.bpm.engine.history.HistoricDecisionInputInstance in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceTest method testMultipleDecisionInputInstances.
@Deployment(resources = { DECISION_PROCESS, DECISION_MULTIPLE_INPUT_DMN })
public void testMultipleDecisionInputInstances() {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("input1", "a");
variables.put("input2", 1);
runtimeService.startProcessInstanceByKey("testProcess", variables);
HistoricDecisionInstance historicDecisionInstance = historyService.createHistoricDecisionInstanceQuery().includeInputs().singleResult();
List<HistoricDecisionInputInstance> inputs = historicDecisionInstance.getInputs();
assertThat(inputs.size(), is(2));
assertThat(inputs.get(0).getValue(), is((Object) "a"));
assertThat(inputs.get(1).getValue(), is((Object) 1));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInputInstance in project camunda-bpm-platform by camunda.
the class HistoricDecisionInstanceTest method testDisableDecisionInputInstanceByteValue.
@Deployment(resources = { DECISION_PROCESS, DECISION_SINGLE_OUTPUT_DMN })
public void testDisableDecisionInputInstanceByteValue() {
byte[] bytes = "object".getBytes();
startProcessInstanceAndEvaluateDecision(bytes);
HistoricDecisionInstance historicDecisionInstance = historyService.createHistoricDecisionInstanceQuery().includeInputs().disableBinaryFetching().singleResult();
List<HistoricDecisionInputInstance> inputs = historicDecisionInstance.getInputs();
assertThat(inputs.size(), is(1));
HistoricDecisionInputInstance input = inputs.get(0);
assertThat(input.getTypeName(), is("bytes"));
assertThat(input.getValue(), is(nullValue()));
}
use of org.camunda.bpm.engine.history.HistoricDecisionInputInstance in project camunda-bpm-platform by camunda.
the class MockProvider method createMockHistoricDecisionInstanceWithInputsAndOutputs.
public static HistoricDecisionInstance createMockHistoricDecisionInstanceWithInputsAndOutputs() {
List<HistoricDecisionInputInstance> inputs = createMockHistoricDecisionInputInstances();
List<HistoricDecisionOutputInstance> outputs = createMockHistoricDecisionOutputInstances();
HistoricDecisionInstance mock = createMockHistoricDecisionInstanceBase();
when(mock.getInputs()).thenReturn(inputs);
when(mock.getOutputs()).thenReturn(outputs);
return mock;
}
use of org.camunda.bpm.engine.history.HistoricDecisionInputInstance in project camunda-bpm-platform by camunda.
the class MockProvider method createMockHistoricDecisionInstanceWithInputs.
public static HistoricDecisionInstance createMockHistoricDecisionInstanceWithInputs() {
List<HistoricDecisionInputInstance> inputs = createMockHistoricDecisionInputInstances();
HistoricDecisionInstance mock = createMockHistoricDecisionInstanceBase();
when(mock.getInputs()).thenReturn(inputs);
when(mock.getOutputs()).thenThrow(new ProcessEngineException("ENGINE-03061 The output instances for the historic decision instance are not fetched. You must call 'includeOutputs()' on the query to enable fetching."));
return mock;
}
use of org.camunda.bpm.engine.history.HistoricDecisionInputInstance in project camunda-bpm-platform by camunda.
the class DefaultDmnHistoryEventProducer method initDecisionInstanceEvent.
protected void initDecisionInstanceEvent(HistoricDecisionInstanceEntity event, DmnDecisionLogicEvaluationEvent evaluationEvent, HistoryEventTypes eventType) {
event.setEventType(eventType.getEventName());
DecisionDefinition decision = (DecisionDefinition) evaluationEvent.getDecision();
event.setDecisionDefinitionId(decision.getId());
event.setDecisionDefinitionKey(decision.getKey());
event.setDecisionDefinitionName(decision.getName());
if (decision.getDecisionRequirementsDefinitionId() != null) {
event.setDecisionRequirementsDefinitionId(decision.getDecisionRequirementsDefinitionId());
event.setDecisionRequirementsDefinitionKey(decision.getDecisionRequirementsDefinitionKey());
}
if (evaluationEvent instanceof DmnDecisionTableEvaluationEvent) {
initDecisionInstanceEventForDecisionTable(event, (DmnDecisionTableEvaluationEvent) evaluationEvent);
} else if (evaluationEvent instanceof DmnDecisionLiteralExpressionEvaluationEvent) {
initDecisionInstanceEventForDecisionLiteralExpression(event, (DmnDecisionLiteralExpressionEvaluationEvent) evaluationEvent);
} else {
event.setInputs(Collections.<HistoricDecisionInputInstance>emptyList());
event.setOutputs(Collections.<HistoricDecisionOutputInstance>emptyList());
}
}
Aggregations