public DecisionTableEvaluationHandler(DefaultDmnEngineConfiguration configuration)
        {
            expressionEvaluationHandler = new ExpressionEvaluationHandler(configuration);
            feelEngine = configuration.FeelEngine;

            EvaluationListeners = configuration.DecisionTableEvaluationListeners;

            inputExpressionExpressionLanguage = configuration.DefaultInputExpressionExpressionLanguage;
            inputEntryExpressionLanguage      = configuration.DefaultInputEntryExpressionLanguage;
            outputEntryExpressionLanguage     = configuration.DefaultOutputEntryExpressionLanguage;
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void setDefaultInputExpressionLanguage()
        public virtual void setDefaultInputExpressionLanguage()
        {
            // given a DMN engine configuration with default expression language
            DefaultDmnEngineConfiguration dmnEngineConfiguration = (DefaultDmnEngineConfiguration)DmnEngineConfiguration.createDefaultDmnEngineConfiguration();

            dmnEngineConfiguration.DefaultInputExpressionExpressionLanguage = "groovy";

            ProcessEngineConfigurationImpl processEngineConfiguration = createProcessEngineConfiguration();

            processEngineConfiguration.DmnEngineConfiguration = dmnEngineConfiguration;

            // when the engine is initialized
            engine = processEngineConfiguration.buildProcessEngine();

            // then the default expression language should be set on the DMN engine
            assertThat(ConfigurationOfDmnEngine.DefaultInputExpressionExpressionLanguage, @is("groovy"));
        }
示例#3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void setElProvider()
        public virtual void setElProvider()
        {
            // given a DMN engine configuration with el provider
            DefaultDmnEngineConfiguration dmnEngineConfiguration = (DefaultDmnEngineConfiguration)DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
            ElProvider elProvider = mock(typeof(ElProvider));

            dmnEngineConfiguration.ElProvider = elProvider;

            ProcessEngineConfigurationImpl processEngineConfiguration = createProcessEngineConfiguration();

            processEngineConfiguration.DmnEngineConfiguration = dmnEngineConfiguration;

            // when the engine is initialized
            engine = processEngineConfiguration.buildProcessEngine();

            // then the el provider should be set on the DMN engine
            assertThat(ConfigurationOfDmnEngine.ElProvider, @is(elProvider));
        }
示例#4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void setDmnEngineConfigurationOverXmlConfiguration()
        public virtual void setDmnEngineConfigurationOverXmlConfiguration()
        {
            // given an embedded DMN engine configuration in XML process engine configuration
            // with default expression language
            ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl)ProcessEngineConfiguration.createProcessEngineConfigurationFromResource(CONFIGURATION_XML);

            // checks that the configuration is set as on XML
            DefaultDmnEngineConfiguration dmnEngineConfiguration = processEngineConfiguration.DmnEngineConfiguration;

            assertThat(dmnEngineConfiguration, @is(notNullValue()));
            assertThat(dmnEngineConfiguration.DefaultInputExpressionExpressionLanguage, @is("groovy"));

            // when the engine is initialized
            engine = processEngineConfiguration.buildProcessEngine();

            // then the default expression language should be set in the DMN engine
            assertThat(ConfigurationOfDmnEngine.DefaultInputExpressionExpressionLanguage, @is("groovy"));
        }
示例#5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void setFeelEngineFactory()
        public virtual void setFeelEngineFactory()
        {
            // given a DMN engine configuration with feel engine factory
            DefaultDmnEngineConfiguration dmnEngineConfiguration = (DefaultDmnEngineConfiguration)DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
            FeelEngineFactory             feelEngineFactory      = mock(typeof(FeelEngineFactory));

            dmnEngineConfiguration.FeelEngineFactory = feelEngineFactory;

            ProcessEngineConfigurationImpl processEngineConfiguration = createProcessEngineConfiguration();

            processEngineConfiguration.DmnEngineConfiguration = dmnEngineConfiguration;

            // when the engine is initialized
            engine = processEngineConfiguration.buildProcessEngine();

            // then the feel engine factory should be set on the DMN engine
            assertThat(ConfigurationOfDmnEngine.FeelEngineFactory, @is(feelEngineFactory));
        }
示例#6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void setScriptEngineResolver()
        public virtual void setScriptEngineResolver()
        {
            // given a DMN engine configuration with script engine resolver
            DefaultDmnEngineConfiguration dmnEngineConfiguration = (DefaultDmnEngineConfiguration)DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
            DmnScriptEngineResolver       scriptEngineResolver   = mock(typeof(DmnScriptEngineResolver));

            dmnEngineConfiguration.ScriptEngineResolver = scriptEngineResolver;

            ProcessEngineConfigurationImpl processEngineConfiguration = createProcessEngineConfiguration();

            processEngineConfiguration.DmnEngineConfiguration = dmnEngineConfiguration;

            // when the engine is initialized
            engine = processEngineConfiguration.buildProcessEngine();

            // then the script engine resolver should be set on the DMN engine
            assertThat(ConfigurationOfDmnEngine.ScriptEngineResolver, @is(scriptEngineResolver));
        }
示例#7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void setCustomPostTableExecutionListener()
        public virtual void setCustomPostTableExecutionListener()
        {
            // given a DMN engine configuration with custom listener
            DefaultDmnEngineConfiguration              dmnEngineConfiguration   = (DefaultDmnEngineConfiguration)DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
            DmnDecisionTableEvaluationListener         customEvaluationListener = mock(typeof(DmnDecisionTableEvaluationListener));
            IList <DmnDecisionTableEvaluationListener> customListeners          = new List <DmnDecisionTableEvaluationListener>();

            customListeners.Add(customEvaluationListener);
            dmnEngineConfiguration.CustomPostDecisionTableEvaluationListeners = customListeners;

            ProcessEngineConfigurationImpl processEngineConfiguration = createProcessEngineConfiguration();

            processEngineConfiguration.DmnEngineConfiguration = dmnEngineConfiguration;

            // when the engine is initialized
            engine = processEngineConfiguration.buildProcessEngine();

            // then the custom listener should be set on the DMN engine
            assertThat(ConfigurationOfDmnEngine.CustomPostDecisionTableEvaluationListeners, hasItem(customEvaluationListener));
        }
        public virtual void setScriptEngineResolver()
        {
            // given a DMN engine configuration with script engine resolver
            DefaultDmnEngineConfiguration dmnEngineConfiguration = (DefaultDmnEngineConfiguration)DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
            // Todo: mockito-core-1.9.5.jar
            //DmnScriptEngineResolver scriptEngineResolver = mock(typeof(DmnScriptEngineResolver));
            IDmnScriptEngineResolver scriptEngineResolver = null;

            dmnEngineConfiguration.ScriptEngineResolver = scriptEngineResolver;

            ProcessEngineConfigurationImpl processEngineConfiguration = createProcessEngineConfiguration();

            processEngineConfiguration.DmnEngineConfiguration = dmnEngineConfiguration;

            // when the engine is initialized
            engine = processEngineConfiguration.BuildProcessEngine();

            // then the script engine resolver should be set on the DMN engine
            Assert.That(ConfigurationOfDmnEngine.ScriptEngineResolver, Is.EqualTo(scriptEngineResolver));
        }
        public virtual void setElProvider()
        {
            // given a DMN engine configuration with el provider
            DefaultDmnEngineConfiguration dmnEngineConfiguration = (DefaultDmnEngineConfiguration)DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
            // Todo: mockito-core-1.9.5.jar
            //ElProvider elProvider = mock(typeof(ElProvider));
            IELProvider elProvider = null;

            dmnEngineConfiguration.ElProvider = elProvider;

            ProcessEngineConfigurationImpl processEngineConfiguration = createProcessEngineConfiguration();

            processEngineConfiguration.DmnEngineConfiguration = dmnEngineConfiguration;

            // when the engine is initialized
            engine = processEngineConfiguration.BuildProcessEngine();

            // then the el provider should be set on the DMN engine
            Assert.That(ConfigurationOfDmnEngine.ElProvider, Is.EqualTo(elProvider));
        }
        public virtual void setCustomPostTableExecutionListener()
        {
            // given a DMN engine configuration with custom listener
            DefaultDmnEngineConfiguration dmnEngineConfiguration = (DefaultDmnEngineConfiguration)DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
            // Todo: mockito-core-1.9.5.jar
            //DmnDecisionTableEvaluationListener customEvaluationListener = mock(typeof(DmnDecisionTableEvaluationListener));
            IDmnDecisionTableEvaluationListener         customEvaluationListener = null;
            IList <IDmnDecisionTableEvaluationListener> customListeners          = new List <IDmnDecisionTableEvaluationListener>();

            customListeners.Add(customEvaluationListener);
            dmnEngineConfiguration.CustomPostDecisionTableEvaluationListeners = customListeners;

            ProcessEngineConfigurationImpl processEngineConfiguration = createProcessEngineConfiguration();

            processEngineConfiguration.DmnEngineConfiguration = dmnEngineConfiguration;

            // when the engine is initialized
            engine = processEngineConfiguration.BuildProcessEngine();

            // then the custom listener should be set on the DMN engine
            //Assert.That(ConfigurationOfDmnEngine.CustomPostDecisionTableEvaluationListeners, hasItem(customEvaluationListener));
            CollectionAssert.Contains(ConfigurationOfDmnEngine.CustomPostDecisionTableEvaluationListeners,
                                      customEvaluationListener);
        }
        public DecisionLiteralExpressionEvaluationHandler(DefaultDmnEngineConfiguration configuration)
        {
            expressionEvaluationHandler = new ExpressionEvaluationHandler(configuration);

            LiteralExpressionLanguage = configuration.DefaultLiteralExpressionLanguage;
        }
示例#12
0
        /// <summary>
        /// Creates a new builder to modify the given DMN engine configuration.
        /// </summary>
        public DmnEngineConfigurationBuilder(DefaultDmnEngineConfiguration dmnEngineConfiguration)
        {
            ensureNotNull("dmnEngineConfiguration", dmnEngineConfiguration);

            this.dmnEngineConfiguration = dmnEngineConfiguration;
        }
示例#13
0
 public ExpressionEvaluationHandler(DefaultDmnEngineConfiguration configuration)
 {
     ScriptEngineResolver = configuration.ScriptEngineResolver;
     elProvider           = configuration.ElProvider;
     feelEngine           = configuration.FeelEngine;
 }