use of org.camunda.bpm.engine.variable.context.VariableContext 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