Search in sources :

Example 26 with DmnDecision

use of org.camunda.bpm.dmn.engine.DmnDecision in project camunda-engine-dmn by camunda.

the class DefaultDmnEngine method evaluateDecisionTable.

public DmnDecisionTableResult evaluateDecisionTable(String decisionKey, InputStream inputStream, VariableContext variableContext) {
    ensureNotNull("decisionKey", decisionKey);
    List<DmnDecision> decisions = parseDecisions(inputStream);
    for (DmnDecision decision : decisions) {
        if (decisionKey.equals(decision.getKey())) {
            return evaluateDecisionTable(decision, variableContext);
        }
    }
    throw LOG.unableToFindDecisionWithKey(decisionKey);
}
Also used : DmnDecision(org.camunda.bpm.dmn.engine.DmnDecision)

Example 27 with DmnDecision

use of org.camunda.bpm.dmn.engine.DmnDecision in project camunda-engine-dmn by camunda.

the class DefaultDmnEngine method evaluateDecision.

public DmnDecisionResult evaluateDecision(String decisionKey, DmnModelInstance dmnModelInstance, VariableContext variableContext) {
    ensureNotNull("decisionKey", decisionKey);
    List<DmnDecision> decisions = parseDecisions(dmnModelInstance);
    for (DmnDecision decision : decisions) {
        if (decisionKey.equals(decision.getKey())) {
            return evaluateDecision(decision, variableContext);
        }
    }
    throw LOG.unableToFindDecisionWithKey(decisionKey);
}
Also used : DmnDecision(org.camunda.bpm.dmn.engine.DmnDecision)

Aggregations

DmnDecision (org.camunda.bpm.dmn.engine.DmnDecision)27 DmnEngineTest (org.camunda.bpm.dmn.engine.test.DmnEngineTest)9 Test (org.junit.Test)9 InputStream (java.io.InputStream)8 Decision (org.camunda.bpm.model.dmn.instance.Decision)7 ArrayList (java.util.ArrayList)5 DmnModelInstance (org.camunda.bpm.model.dmn.DmnModelInstance)5 DmnDecisionImpl (org.camunda.bpm.dmn.engine.impl.DmnDecisionImpl)3 DmnDecisionLiteralExpressionImpl (org.camunda.bpm.dmn.engine.impl.DmnDecisionLiteralExpressionImpl)2 DmnDecisionTableImpl (org.camunda.bpm.dmn.engine.impl.DmnDecisionTableImpl)2 Definitions (org.camunda.bpm.model.dmn.instance.Definitions)2 List (java.util.List)1 DmnDecisionRequirementsGraph (org.camunda.bpm.dmn.engine.DmnDecisionRequirementsGraph)1 DmnDecisionResult (org.camunda.bpm.dmn.engine.DmnDecisionResult)1 DmnEngine (org.camunda.bpm.dmn.engine.DmnEngine)1 DmnDecisionLogicEvaluationEvent (org.camunda.bpm.dmn.engine.delegate.DmnDecisionLogicEvaluationEvent)1 DmnDecisionRequirementsGraphImpl (org.camunda.bpm.dmn.engine.impl.DmnDecisionRequirementsGraphImpl)1 DmnExpressionImpl (org.camunda.bpm.dmn.engine.impl.DmnExpressionImpl)1 DmnVariableImpl (org.camunda.bpm.dmn.engine.impl.DmnVariableImpl)1 DmnDecisionLogicEvaluationHandler (org.camunda.bpm.dmn.engine.impl.evaluation.DmnDecisionLogicEvaluationHandler)1