use of org.camunda.bpm.dmn.engine.impl.DmnDecisionResultImpl in project camunda-engine-dmn by camunda.
the class DecisionLiteralExpressionEvaluationHandler method generateDecisionResult.
@Override
public DmnDecisionResult generateDecisionResult(DmnDecisionLogicEvaluationEvent event) {
DmnDecisionLiteralExpressionEvaluationEvent evaluationEvent = (DmnDecisionLiteralExpressionEvaluationEvent) event;
DmnDecisionResultEntriesImpl result = new DmnDecisionResultEntriesImpl();
result.putValue(evaluationEvent.getOutputName(), evaluationEvent.getOutputValue());
return new DmnDecisionResultImpl(Collections.<DmnDecisionResultEntries>singletonList(result));
}
use of org.camunda.bpm.dmn.engine.impl.DmnDecisionResultImpl 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