use of org.camunda.bpm.dmn.engine.delegate.DmnEvaluatedInput in project camunda-bpm-platform by camunda.
the class DefaultDmnHistoryEventProducer method createHistoricDecisionInputInstances.
protected List<HistoricDecisionInputInstance> createHistoricDecisionInputInstances(DmnDecisionTableEvaluationEvent evaluationEvent) {
List<HistoricDecisionInputInstance> inputInstances = new ArrayList<HistoricDecisionInputInstance>();
for (DmnEvaluatedInput inputClause : evaluationEvent.getInputs()) {
HistoricDecisionInputInstanceEntity inputInstance = new HistoricDecisionInputInstanceEntity();
inputInstance.setClauseId(inputClause.getId());
inputInstance.setClauseName(inputClause.getName());
TypedValue typedValue = Variables.untypedValue(inputClause.getValue());
inputInstance.setValue(typedValue);
inputInstances.add(inputInstance);
}
return inputInstances;
}
use of org.camunda.bpm.dmn.engine.delegate.DmnEvaluatedInput in project camunda-engine-dmn by camunda.
the class DecisionTableEvaluationHandler method evaluateDecisionTable.
protected void evaluateDecisionTable(DmnDecisionTableImpl decisionTable, VariableContext variableContext, DmnDecisionTableEvaluationEventImpl evaluationResult) {
int inputSize = decisionTable.getInputs().size();
List<DmnDecisionTableRuleImpl> matchingRules = new ArrayList<DmnDecisionTableRuleImpl>(decisionTable.getRules());
for (int inputIdx = 0; inputIdx < inputSize; inputIdx++) {
// evaluate input
DmnDecisionTableInputImpl input = decisionTable.getInputs().get(inputIdx);
DmnEvaluatedInput evaluatedInput = evaluateInput(input, variableContext);
evaluationResult.getInputs().add(evaluatedInput);
// compose local variable context out of global variable context enhanced with the value of the current input.
VariableContext localVariableContext = getLocalVariableContext(input, evaluatedInput, variableContext);
// filter rules applicable with this input
matchingRules = evaluateInputForAvailableRules(inputIdx, input, matchingRules, localVariableContext);
}
setEvaluationOutput(decisionTable, matchingRules, variableContext, evaluationResult);
}
Aggregations