use of org.camunda.bpm.dmn.feel.impl.juel.FeelEngineFactoryImpl 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);
}
use of org.camunda.bpm.dmn.feel.impl.juel.FeelEngineFactoryImpl 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);
}
use of org.camunda.bpm.dmn.feel.impl.juel.FeelEngineFactoryImpl in project camunda-engine-dmn by camunda.
the class FeelEngineCustomFunctionTest method initEngine.
@Before
public void initEngine() {
variables = Variables.createVariables();
List<FeelToJuelFunctionTransformer> customFunctionTransformers = new ArrayList<FeelToJuelFunctionTransformer>();
customFunctionTransformers.add(new StartsWithFunctionTransformer());
FeelEngineFactoryImpl feelEngineFactory = new FeelEngineFactoryImpl(customFunctionTransformers);
feelEngine = feelEngineFactory.createInstance();
}
use of org.camunda.bpm.dmn.feel.impl.juel.FeelEngineFactoryImpl 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();
}
use of org.camunda.bpm.dmn.feel.impl.juel.FeelEngineFactoryImpl 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);
}
Aggregations