예제 #1
0
        public virtual IDmnDecisionResult EvaluateDecision(IDmnDecision decision, IVariableContext variableContext)
        {
            EnsureUtil.EnsureNotNull("decision", decision);
            EnsureUtil.EnsureNotNull("variableContext", variableContext);

            if (decision is DmnDecisionImpl)
            {
                var decisionContext = new DefaultDmnDecisionContext(dmnEngineConfiguration);
                return(decisionContext.evaluateDecision(decision, variableContext));
            }
            throw LOG.decisionTypeNotSupported(decision);
        }
예제 #2
0
        public virtual IDmnDecisionTableResult EvaluateDecisionTable(IDmnDecision decision,
                                                                     IVariableContext variableContext)
        {
            EnsureUtil.EnsureNotNull("decision", decision);
            EnsureUtil.EnsureNotNull("variableContext", variableContext);

            if (decision is DmnDecisionImpl && decision.DecisionTable)
            {
                var decisionContext = new DefaultDmnDecisionContext(dmnEngineConfiguration);

                var decisionResult = decisionContext.evaluateDecision(decision, variableContext);
                return(DmnDecisionTableResultImpl.Wrap(decisionResult));
            }
            throw LOG.decisionIsNotADecisionTable(decision);
        }