Search in sources :

Example 11 with DefaultDmnEngineConfiguration

use of org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration in project camunda-bpm-platform by camunda.

the class DmnEngineConfigurationTest method getConfigurationOfDmnEngine.

protected DefaultDmnEngineConfiguration getConfigurationOfDmnEngine() {
    ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) engine.getProcessEngineConfiguration();
    DmnEngine dmnEngine = processEngineConfiguration.getDmnEngine();
    return (DefaultDmnEngineConfiguration) dmnEngine.getConfiguration();
}
Also used : DmnEngine(org.camunda.bpm.dmn.engine.DmnEngine) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) DefaultDmnEngineConfiguration(org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration)

Example 12 with DefaultDmnEngineConfiguration

use of org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration in project camunda-bpm-platform by camunda.

the class DmnEngineConfigurationTest method setScriptEngineResolver.

@Test
public void setScriptEngineResolver() {
    // given a DMN engine configuration with script engine resolver
    DefaultDmnEngineConfiguration dmnEngineConfiguration = (DefaultDmnEngineConfiguration) DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
    DmnScriptEngineResolver scriptEngineResolver = mock(DmnScriptEngineResolver.class);
    dmnEngineConfiguration.setScriptEngineResolver(scriptEngineResolver);
    ProcessEngineConfigurationImpl processEngineConfiguration = createProcessEngineConfiguration();
    processEngineConfiguration.setDmnEngineConfiguration(dmnEngineConfiguration);
    // when the engine is initialized
    engine = processEngineConfiguration.buildProcessEngine();
    // then the script engine resolver should be set on the DMN engine
    assertThat(getConfigurationOfDmnEngine().getScriptEngineResolver(), is(scriptEngineResolver));
}
Also used : DmnScriptEngineResolver(org.camunda.bpm.dmn.engine.impl.spi.el.DmnScriptEngineResolver) DefaultDmnEngineConfiguration(org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) Test(org.junit.Test)

Example 13 with DefaultDmnEngineConfiguration

use of org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration in project camunda-bpm-platform by camunda.

the class DmnEngineConfigurationTest method setDefaultInputExpressionLanguage.

@Test
public void setDefaultInputExpressionLanguage() {
    // given a DMN engine configuration with default expression language
    DefaultDmnEngineConfiguration dmnEngineConfiguration = (DefaultDmnEngineConfiguration) DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
    dmnEngineConfiguration.setDefaultInputExpressionExpressionLanguage("groovy");
    ProcessEngineConfigurationImpl processEngineConfiguration = createProcessEngineConfiguration();
    processEngineConfiguration.setDmnEngineConfiguration(dmnEngineConfiguration);
    // when the engine is initialized
    engine = processEngineConfiguration.buildProcessEngine();
    // then the default expression language should be set on the DMN engine
    assertThat(getConfigurationOfDmnEngine().getDefaultInputExpressionExpressionLanguage(), is("groovy"));
}
Also used : DefaultDmnEngineConfiguration(org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration) ProcessEngineConfigurationImpl(org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl) Test(org.junit.Test)

Example 14 with DefaultDmnEngineConfiguration

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

the class CustomDataTypeTransformerRegistryTest method getDmnEngineConfiguration.

@Override
public DmnEngineConfiguration getDmnEngineConfiguration() {
    DefaultDmnEngineConfiguration configuration = new DefaultDmnEngineConfiguration();
    configuration.getTransformer().setDataTypeTransformerRegistry(new CustomDataTypeTransformerRegistry());
    return configuration;
}
Also used : DefaultDmnEngineConfiguration(org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration)

Example 15 with DefaultDmnEngineConfiguration

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

the class DataTypeTransformerIntegrationTest method getDmnEngineConfiguration.

@Override
public DmnEngineConfiguration getDmnEngineConfiguration() {
    DefaultDmnEngineConfiguration configuration = new DefaultDmnEngineConfiguration();
    dataTypeTransformerMock = mock(DmnDataTypeTransformer.class);
    when(dataTypeTransformerMock.transform(any())).thenReturn(TRANSFORMED_VALUE);
    DmnDataTypeTransformerRegistry dataTypeTransformerRegistry = mock(DmnDataTypeTransformerRegistry.class);
    when(dataTypeTransformerRegistry.getTransformer(anyString())).thenReturn(dataTypeTransformerMock);
    configuration.getTransformer().setDataTypeTransformerRegistry(dataTypeTransformerRegistry);
    return configuration;
}
Also used : DmnDataTypeTransformerRegistry(org.camunda.bpm.dmn.engine.impl.spi.type.DmnDataTypeTransformerRegistry) DefaultDmnEngineConfiguration(org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration) DmnDataTypeTransformer(org.camunda.bpm.dmn.engine.impl.spi.type.DmnDataTypeTransformer)

Aggregations

DefaultDmnEngineConfiguration (org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration)19 Test (org.junit.Test)11 ProcessEngineConfigurationImpl (org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl)7 DmnEngine (org.camunda.bpm.dmn.engine.DmnEngine)6 DecisionResource (org.camunda.bpm.dmn.engine.test.DecisionResource)5 DmnEngineTest (org.camunda.bpm.dmn.engine.test.DmnEngineTest)5 DmnDecisionResult (org.camunda.bpm.dmn.engine.DmnDecisionResult)3 VariableContext (org.camunda.bpm.engine.variable.context.VariableContext)3 Before (org.junit.Before)2 ArrayList (java.util.ArrayList)1 Compilable (javax.script.Compilable)1 ScriptEngine (javax.script.ScriptEngine)1 ScriptEngineManager (javax.script.ScriptEngineManager)1 DmnEngineConfiguration (org.camunda.bpm.dmn.engine.DmnEngineConfiguration)1 DmnDecisionTableEvaluationListener (org.camunda.bpm.dmn.engine.delegate.DmnDecisionTableEvaluationListener)1 DefaultScriptEngineResolver (org.camunda.bpm.dmn.engine.impl.el.DefaultScriptEngineResolver)1 ExpressionEvaluationHandler (org.camunda.bpm.dmn.engine.impl.evaluation.ExpressionEvaluationHandler)1 DmnScriptEngineResolver (org.camunda.bpm.dmn.engine.impl.spi.el.DmnScriptEngineResolver)1 ElProvider (org.camunda.bpm.dmn.engine.impl.spi.el.ElProvider)1 DmnDataTypeTransformer (org.camunda.bpm.dmn.engine.impl.spi.type.DmnDataTypeTransformer)1