Search in sources :

Example 1 with FeelEngineFactory

use of org.camunda.bpm.dmn.feel.impl.FeelEngineFactory in project camunda-engine-dmn by camunda.

the class DefaultDmnEngineConfigurationApiTest method shouldSetFeelEngineFactory.

@Test
public void shouldSetFeelEngineFactory() {
    configuration.setFeelEngineFactory(null);
    assertThat(configuration.getFeelEngineFactory()).isNull();
    FeelEngineFactory feelEngineFactory = new FeelEngineFactoryImpl();
    configuration.setFeelEngineFactory(feelEngineFactory);
    assertThat(configuration.getFeelEngineFactory()).isEqualTo(feelEngineFactory);
}
Also used : FeelEngineFactory(org.camunda.bpm.dmn.feel.impl.FeelEngineFactory) FeelEngineFactoryImpl(org.camunda.bpm.dmn.feel.impl.juel.FeelEngineFactoryImpl) Test(org.junit.Test)

Example 2 with FeelEngineFactory

use of org.camunda.bpm.dmn.feel.impl.FeelEngineFactory in project camunda-engine-dmn by camunda.

the class DefaultDmnEngineConfigurationApiTest method shouldBeFluentConfigurable.

@Test
public void shouldBeFluentConfigurable() {
    DefaultEngineMetricCollector metricCollector = new DefaultEngineMetricCollector();
    ArrayList<DmnDecisionTableEvaluationListener> preListeners = new ArrayList<DmnDecisionTableEvaluationListener>();
    preListeners.add(new DefaultEngineMetricCollector());
    ArrayList<DmnDecisionTableEvaluationListener> postListeners = new ArrayList<DmnDecisionTableEvaluationListener>();
    preListeners.add(new DefaultEngineMetricCollector());
    ArrayList<DmnDecisionEvaluationListener> preDecisionListeners = new ArrayList<DmnDecisionEvaluationListener>();
    preDecisionListeners.add(new TestDecisionEvaluationListener());
    ArrayList<DmnDecisionEvaluationListener> postDecisionListeners = new ArrayList<DmnDecisionEvaluationListener>();
    postDecisionListeners.add(new TestDecisionEvaluationListener());
    DefaultScriptEngineResolver scriptEngineResolver = new DefaultScriptEngineResolver();
    ElProvider elProvider = new JuelElProvider();
    FeelEngineFactory feelEngineFactory = new FeelEngineFactoryImpl();
    DmnTransformer transformer = new DefaultDmnTransformer();
    DmnEngine engine = configuration.engineMetricCollector(metricCollector).customPreDecisionTableEvaluationListeners(preListeners).customPostDecisionTableEvaluationListeners(postListeners).customPreDecisionEvaluationListeners(preDecisionListeners).customPostDecisionEvaluationListeners(postDecisionListeners).scriptEngineResolver(scriptEngineResolver).elProvider(elProvider).feelEngineFactory(feelEngineFactory).defaultInputExpressionExpressionLanguage("camunda").defaultInputEntryExpressionLanguage("camunda").defaultOutputEntryExpressionLanguage("camunda").transformer(transformer).buildEngine();
    configuration = (DefaultDmnEngineConfiguration) engine.getConfiguration();
    assertThat(configuration.getEngineMetricCollector()).isEqualTo(metricCollector);
    assertThat(configuration.getCustomPreDecisionTableEvaluationListeners()).containsExactlyElementsOf(preListeners);
    assertThat(configuration.getCustomPostDecisionTableEvaluationListeners()).containsExactlyElementsOf(postListeners);
    assertThat(configuration.getCustomPreDecisionEvaluationListeners()).containsExactlyElementsOf(preDecisionListeners);
    assertThat(configuration.getCustomPostDecisionEvaluationListeners()).containsExactlyElementsOf(postDecisionListeners);
    assertThat(configuration.getScriptEngineResolver()).isEqualTo(scriptEngineResolver);
    assertThat(configuration.getElProvider()).isEqualTo(elProvider);
    assertThat(configuration.getFeelEngineFactory()).isEqualTo(feelEngineFactory);
    assertThat(configuration.getDefaultInputExpressionExpressionLanguage()).isEqualTo("camunda");
    assertThat(configuration.getDefaultInputEntryExpressionLanguage()).isEqualTo("camunda");
    assertThat(configuration.getDefaultOutputEntryExpressionLanguage()).isEqualTo("camunda");
    assertThat(configuration.getTransformer()).isEqualTo(transformer);
}
Also used : DmnDecisionEvaluationListener(org.camunda.bpm.dmn.engine.delegate.DmnDecisionEvaluationListener) ArrayList(java.util.ArrayList) DefaultDmnTransformer(org.camunda.bpm.dmn.engine.impl.transform.DefaultDmnTransformer) DefaultEngineMetricCollector(org.camunda.bpm.dmn.engine.impl.metrics.DefaultEngineMetricCollector) FeelEngineFactory(org.camunda.bpm.dmn.feel.impl.FeelEngineFactory) FeelEngineFactoryImpl(org.camunda.bpm.dmn.feel.impl.juel.FeelEngineFactoryImpl) ElProvider(org.camunda.bpm.dmn.engine.impl.spi.el.ElProvider) JuelElProvider(org.camunda.bpm.dmn.engine.impl.el.JuelElProvider) DefaultDmnEngine(org.camunda.bpm.dmn.engine.impl.DefaultDmnEngine) DmnEngine(org.camunda.bpm.dmn.engine.DmnEngine) JuelElProvider(org.camunda.bpm.dmn.engine.impl.el.JuelElProvider) DefaultDmnTransformer(org.camunda.bpm.dmn.engine.impl.transform.DefaultDmnTransformer) DmnTransformer(org.camunda.bpm.dmn.engine.impl.spi.transform.DmnTransformer) DefaultScriptEngineResolver(org.camunda.bpm.dmn.engine.impl.el.DefaultScriptEngineResolver) DmnDecisionTableEvaluationListener(org.camunda.bpm.dmn.engine.delegate.DmnDecisionTableEvaluationListener) Test(org.junit.Test)

Example 3 with FeelEngineFactory

use of org.camunda.bpm.dmn.feel.impl.FeelEngineFactory in project camunda-bpm-platform by camunda.

the class DmnEngineConfigurationTest method setFeelEngineFactory.

@Test
public void setFeelEngineFactory() {
    // given a DMN engine configuration with feel engine factory
    DefaultDmnEngineConfiguration dmnEngineConfiguration = (DefaultDmnEngineConfiguration) DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
    FeelEngineFactory feelEngineFactory = mock(FeelEngineFactory.class);
    dmnEngineConfiguration.setFeelEngineFactory(feelEngineFactory);
    ProcessEngineConfigurationImpl processEngineConfiguration = createProcessEngineConfiguration();
    processEngineConfiguration.setDmnEngineConfiguration(dmnEngineConfiguration);
    // when the engine is initialized
    engine = processEngineConfiguration.buildProcessEngine();
    // then the feel engine factory should be set on the DMN engine
    assertThat(getConfigurationOfDmnEngine().getFeelEngineFactory(), is(feelEngineFactory));
}
Also used : DefaultDmnEngineConfiguration(org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) FeelEngineFactory(org.camunda.bpm.dmn.feel.impl.FeelEngineFactory) Test(org.junit.Test)

Example 4 with FeelEngineFactory

use of org.camunda.bpm.dmn.feel.impl.FeelEngineFactory in project camunda-engine-dmn by camunda.

the class DefaultDmnEngineConfigurationApiTest method shouldInitFeelEngine.

@Test
public void shouldInitFeelEngine() {
    FeelEngineFactory feelEngineFactory = new FeelEngineFactoryImpl();
    configuration.setFeelEngineFactory(feelEngineFactory);
    configuration.buildEngine();
    assertThat(configuration.getFeelEngine()).isInstanceOf(FeelEngineImpl.class).isNotNull();
}
Also used : FeelEngineImpl(org.camunda.bpm.dmn.feel.impl.juel.FeelEngineImpl) FeelEngineFactory(org.camunda.bpm.dmn.feel.impl.FeelEngineFactory) FeelEngineFactoryImpl(org.camunda.bpm.dmn.feel.impl.juel.FeelEngineFactoryImpl) Test(org.junit.Test)

Example 5 with FeelEngineFactory

use of org.camunda.bpm.dmn.feel.impl.FeelEngineFactory in project camunda-engine-dmn by camunda.

the class DefaultDmnEngineConfigurationApiTest method shouldSetFluentFeelEngineFactory.

@Test
public void shouldSetFluentFeelEngineFactory() {
    configuration.feelEngineFactory(null);
    assertThat(configuration.getFeelEngineFactory()).isNull();
    FeelEngineFactory feelEngineFactory = new FeelEngineFactoryImpl();
    configuration.feelEngineFactory(feelEngineFactory);
    assertThat(configuration.getFeelEngineFactory()).isEqualTo(feelEngineFactory);
}
Also used : FeelEngineFactory(org.camunda.bpm.dmn.feel.impl.FeelEngineFactory) FeelEngineFactoryImpl(org.camunda.bpm.dmn.feel.impl.juel.FeelEngineFactoryImpl) Test(org.junit.Test)

Aggregations

FeelEngineFactory (org.camunda.bpm.dmn.feel.impl.FeelEngineFactory)5 Test (org.junit.Test)5 FeelEngineFactoryImpl (org.camunda.bpm.dmn.feel.impl.juel.FeelEngineFactoryImpl)4 ArrayList (java.util.ArrayList)1 DmnEngine (org.camunda.bpm.dmn.engine.DmnEngine)1 DmnDecisionEvaluationListener (org.camunda.bpm.dmn.engine.delegate.DmnDecisionEvaluationListener)1 DmnDecisionTableEvaluationListener (org.camunda.bpm.dmn.engine.delegate.DmnDecisionTableEvaluationListener)1 DefaultDmnEngine (org.camunda.bpm.dmn.engine.impl.DefaultDmnEngine)1 DefaultDmnEngineConfiguration (org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration)1 DefaultScriptEngineResolver (org.camunda.bpm.dmn.engine.impl.el.DefaultScriptEngineResolver)1 JuelElProvider (org.camunda.bpm.dmn.engine.impl.el.JuelElProvider)1 DefaultEngineMetricCollector (org.camunda.bpm.dmn.engine.impl.metrics.DefaultEngineMetricCollector)1 ElProvider (org.camunda.bpm.dmn.engine.impl.spi.el.ElProvider)1 DmnTransformer (org.camunda.bpm.dmn.engine.impl.spi.transform.DmnTransformer)1 DefaultDmnTransformer (org.camunda.bpm.dmn.engine.impl.transform.DefaultDmnTransformer)1 FeelEngineImpl (org.camunda.bpm.dmn.feel.impl.juel.FeelEngineImpl)1 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)1