use of org.camunda.bpm.dmn.engine.delegate.DmnDecisionTableEvaluationEvent 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());
}
}
use of org.camunda.bpm.dmn.engine.delegate.DmnDecisionTableEvaluationEvent 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