use of org.camunda.bpm.dmn.engine.DmnDecisionResultEntries in project camunda-engine-dmn by camunda.
the class DmnDecisionTableResultImpl method wrap.
public static DmnDecisionTableResultImpl wrap(DmnDecisionResult decisionResult) {
List<DmnDecisionRuleResult> ruleResults = new ArrayList<DmnDecisionRuleResult>();
for (DmnDecisionResultEntries result : decisionResult) {
DmnDecisionRuleResultImpl ruleResult = new DmnDecisionRuleResultImpl();
ruleResult.putAllValues(result.getEntryMapTyped());
ruleResults.add(ruleResult);
}
return new DmnDecisionTableResultImpl(ruleResults);
}
use of org.camunda.bpm.dmn.engine.DmnDecisionResultEntries in project camunda-engine-dmn by camunda.
the class DecisionTableEvaluationHandler method generateDecisionResult.
@Override
public DmnDecisionResult generateDecisionResult(DmnDecisionLogicEvaluationEvent event) {
DmnDecisionTableEvaluationEvent evaluationResult = (DmnDecisionTableEvaluationEvent) event;
List<DmnDecisionResultEntries> ruleResults = new ArrayList<DmnDecisionResultEntries>();
if (evaluationResult.getCollectResultName() != null || evaluationResult.getCollectResultValue() != null) {
DmnDecisionResultEntriesImpl ruleResult = new DmnDecisionResultEntriesImpl();
ruleResult.putValue(evaluationResult.getCollectResultName(), evaluationResult.getCollectResultValue());
ruleResults.add(ruleResult);
} else {
for (DmnEvaluatedDecisionRule evaluatedRule : evaluationResult.getMatchingRules()) {
DmnDecisionResultEntriesImpl ruleResult = new DmnDecisionResultEntriesImpl();
for (DmnEvaluatedOutput evaluatedOutput : evaluatedRule.getOutputEntries().values()) {
ruleResult.putValue(evaluatedOutput.getOutputName(), evaluatedOutput.getValue());
}
ruleResults.add(ruleResult);
}
}
return new DmnDecisionResultImpl(ruleResults);
}
Aggregations