Пример #1
0
        public virtual void evaluateDecisionTableByKeyAndLatestVersion()
        {
            testRule.Deploy(DMN_DECISION_TABLE_V2);

            IDmnDecisionTableResult decisionResult = decisionService.EvaluateDecisionTableByKey(DECISION_DEFINITION_KEY, createVariables());

            AssertThatDecisionHasResult(decisionResult, RESULT_OF_SECOND_VERSION);
        }
Пример #2
0
        public virtual void evaluateDecisionTableById()
        {
            IDecisionDefinition decisionDefinition = repositoryService.CreateDecisionDefinitionQuery().First();

            IDmnDecisionTableResult decisionResult = decisionService.EvaluateDecisionTableById(decisionDefinition.Id, createVariables());

            AssertThatDecisionHasResult(decisionResult, RESULT_OF_FIRST_VERSION);
        }
Пример #3
0
        public virtual bool Evaluate(IDelegateCaseExecution caseExecution)
        {
            IDecisionService        decisionService = caseExecution.ProcessEngineServices.DecisionService;
            IDmnDecisionTableResult result          = EvaluateDecision(decisionService, caseExecution);
            IDmnDecisionRuleResult  singleResult    = result.GetSingleResult();

            return((bool)singleResult.getFirstEntry <bool>());
        }
Пример #4
0
        protected internal virtual void AssertThatDecisionHasResult(IDmnDecisionTableResult decisionResult, object expectedValue)
        {
            //Assert.That(decisionResult, Is.EqualTo(notNullValue()));
            Assert.NotNull(decisionResult);
            Assert.That(decisionResult.Count, Is.EqualTo(1));
            //string value = decisionResult.SingleResult.FirstEntry;
            string value = decisionResult.GetSingleResult().getFirstEntry <string>();

            Assert.That(value, Is.EqualTo(expectedValue));
        }
Пример #5
0
        public virtual void evaluateDecisionTableByKey()
        {
            IDmnDecisionTableResult decisionResult = decisionService.EvaluateDecisionTableByKey(DECISION_DEFINITION_KEY, createVariables());

            AssertThatDecisionHasResult(decisionResult, RESULT_OF_FIRST_VERSION);
        }
Пример #6
0
        public virtual void evaluateDecisionWithRequiredDecisions()
        {
            IDmnDecisionTableResult decisionResult = decisionService.EvaluateDecisionTableByKey("dish-decision", ESS.FW.Bpm.Engine.Variable.Variables.CreateVariables().PutValue("temperature", 32).PutValue("dayType", "Weekend"));

            AssertThatDecisionHasResult(decisionResult, "Light salad");
        }