use of org.camunda.bpm.model.dmn.instance.Decision in project camunda-engine-dmn by camunda.
the class DefaultDmnTransform method getRequiredDmnDecisions.
protected List<DmnDecision> getRequiredDmnDecisions(Decision decision, Map<String, DmnDecisionImpl> dmnDecisions) {
List<DmnDecision> requiredDecisionList = new ArrayList<DmnDecision>();
for (InformationRequirement informationRequirement : decision.getInformationRequirements()) {
Decision requiredDecision = informationRequirement.getRequiredDecision();
if (requiredDecision != null) {
DmnDecision requiredDmnDecision = dmnDecisions.get(requiredDecision.getId());
requiredDecisionList.add(requiredDmnDecision);
}
}
return requiredDecisionList;
}
use of org.camunda.bpm.model.dmn.instance.Decision in project camunda-engine-dmn by camunda.
the class DefaultDmnTransform method buildDecisionRequirements.
protected void buildDecisionRequirements(Collection<Decision> decisions, Map<String, DmnDecisionImpl> dmnDecisions) {
for (Decision decision : decisions) {
List<DmnDecision> requiredDmnDecisions = getRequiredDmnDecisions(decision, dmnDecisions);
DmnDecisionImpl dmnDecision = dmnDecisions.get(decision.getId());
if (requiredDmnDecisions.size() > 0) {
dmnDecision.setRequiredDecision(requiredDmnDecisions);
}
}
}
use of org.camunda.bpm.model.dmn.instance.Decision in project camunda-engine-dmn by camunda.
the class DefaultDmnTransform method transformDecision.
protected DmnDecisionImpl transformDecision(Decision decision) {
DmnElementTransformHandler<Decision, DmnDecisionImpl> handler = handlerRegistry.getHandler(Decision.class);
DmnDecisionImpl dmnDecision = handler.handleElement(this, decision);
this.decision = dmnDecision;
// validate decision id
if (dmnDecision.getKey() == null) {
throw LOG.decisionIdIsMissing(dmnDecision);
}
Expression expression = decision.getExpression();
if (expression == null) {
LOG.decisionWithoutExpression(decision);
return null;
}
if (expression instanceof DecisionTable) {
DmnDecisionTableImpl dmnDecisionTable = transformDecisionTable((DecisionTable) expression);
dmnDecision.setDecisionLogic(dmnDecisionTable);
} else if (expression instanceof LiteralExpression) {
DmnDecisionLiteralExpressionImpl dmnDecisionLiteralExpression = transformDecisionLiteralExpression(decision, (LiteralExpression) expression);
dmnDecision.setDecisionLogic(dmnDecisionLiteralExpression);
} else {
LOG.decisionTypeNotSupported(expression, decision);
return null;
}
return dmnDecision;
}
Aggregations