本文整理汇总了Java中org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java DefaultDmnEngineConfiguration类的具体用法?Java DefaultDmnEngineConfiguration怎么用?Java DefaultDmnEngineConfiguration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultDmnEngineConfiguration类属于org.camunda.bpm.dmn.engine.impl包,在下文中一共展示了DefaultDmnEngineConfiguration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testFeelInputExpression
import org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration; //导入依赖的package包/类
@Test
@DecisionResource(resource = DMN)
public void testFeelInputExpression() {
DefaultDmnEngineConfiguration configuration = (DefaultDmnEngineConfiguration) getDmnEngineConfiguration();
configuration.setDefaultInputExpressionExpressionLanguage(DefaultDmnEngineConfiguration.FEEL_EXPRESSION_LANGUAGE);
DmnEngine engine = configuration.buildEngine();
try {
engine.evaluateDecision(decision, Variables.createVariables().putValue("score", 3));
failBecauseExceptionWasNotThrown(UnsupportedOperationException.class);
}
catch (UnsupportedOperationException e) {
assertThat(e).hasMessageStartingWith("FEEL-01016");
verify(feelEngineSpy).evaluateSimpleExpression(anyString(), any(VariableContext.class));
}
}
示例2: testFeelOutputEntry
import org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration; //导入依赖的package包/类
@Test
@DecisionResource(resource = DMN)
public void testFeelOutputEntry() {
DefaultDmnEngineConfiguration configuration = (DefaultDmnEngineConfiguration) getDmnEngineConfiguration();
configuration.setDefaultOutputEntryExpressionLanguage(DefaultDmnEngineConfiguration.FEEL_EXPRESSION_LANGUAGE);
DmnEngine engine = configuration.buildEngine();
try {
engine.evaluateDecision(decision, Variables.createVariables().putValue("score", 3));
failBecauseExceptionWasNotThrown(UnsupportedOperationException.class);
}
catch (UnsupportedOperationException e) {
assertThat(e).hasMessageStartingWith("FEEL-01016");
verify(feelEngineSpy).evaluateSimpleExpression(anyString(), any(VariableContext.class));
}
}
示例3: testFeelInputExpressionWithCustomEngine
import org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration; //导入依赖的package包/类
@Test
@DecisionResource(resource = DMN)
public void testFeelInputExpressionWithCustomEngine() {
DefaultDmnEngineConfiguration configuration = (DefaultDmnEngineConfiguration) getDmnEngineConfiguration();
configuration.setDefaultInputExpressionExpressionLanguage(DefaultDmnEngineConfiguration.FEEL_EXPRESSION_LANGUAGE);
DmnEngine engine = configuration.buildEngine();
// stubbing the default FEEL engine behavior
doReturn(3).when(feelEngineSpy).evaluateSimpleExpression(eq("score"), any(VariableContext.class));
DmnDecisionResult decisionResult = engine.evaluateDecision(decision, Variables.createVariables().putValue("score", 3));
assertThat(decisionResult.getSingleEntry()).isEqualTo("a");
verify(feelEngineSpy).evaluateSimpleExpression(anyString(), any(VariableContext.class));
}
示例4: testFeelOutputEntryWithCustomEngine
import org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration; //导入依赖的package包/类
@Test
@DecisionResource(resource = DMN)
public void testFeelOutputEntryWithCustomEngine() {
DefaultDmnEngineConfiguration configuration = (DefaultDmnEngineConfiguration) getDmnEngineConfiguration();
configuration.setDefaultOutputEntryExpressionLanguage(DefaultDmnEngineConfiguration.FEEL_EXPRESSION_LANGUAGE);
DmnEngine engine = configuration.buildEngine();
// stubbing the default FEEL engine behavior
doReturn("a").when(feelEngineSpy).evaluateSimpleExpression(eq("\"a\""), any(VariableContext.class));
DmnDecisionResult decisionResult = engine.evaluateDecision(decision, Variables.createVariables().putValue("score", 3));
assertThat(decisionResult.getSingleEntry()).isEqualTo("a");
verify(feelEngineSpy).evaluateSimpleExpression(anyString(), any(VariableContext.class));
}
示例5: setup
import org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration; //导入依赖的package包/类
@Before
public void setup() {
ScriptEngineManager scriptEngineManager = spy(new ScriptEngineManager());
when(scriptEngineManager.getEngineByName(anyString())).then(new Answer<ScriptEngine>() {
public ScriptEngine answer(InvocationOnMock invocation) throws Throwable {
scriptEngineSpy = spy((ScriptEngine) invocation.callRealMethod());
compilableSpy = (Compilable) scriptEngineSpy;
return scriptEngineSpy;
}
});
DefaultDmnEngineConfiguration configuration = new DefaultDmnEngineConfiguration();
configuration.setScriptEngineResolver(new DefaultScriptEngineResolver(scriptEngineManager));
configuration.init();
elProviderSpy = spy(configuration.getElProvider());
configuration.setElProvider(elProviderSpy);
expressionEvaluationHandler = new ExpressionEvaluationHandler(configuration);
}
示例6: setCustomPostTableExecutionListener
import org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration; //导入依赖的package包/类
@Test
public void setCustomPostTableExecutionListener() {
// given a DMN engine configuration with custom listener
DefaultDmnEngineConfiguration dmnEngineConfiguration = (DefaultDmnEngineConfiguration) DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
DmnDecisionTableEvaluationListener customEvaluationListener = mock(DmnDecisionTableEvaluationListener.class);
List<DmnDecisionTableEvaluationListener> customListeners = new ArrayList<DmnDecisionTableEvaluationListener>();
customListeners.add(customEvaluationListener);
dmnEngineConfiguration.setCustomPostDecisionTableEvaluationListeners(customListeners);
ProcessEngineConfigurationImpl processEngineConfiguration = createProcessEngineConfiguration();
processEngineConfiguration.setDmnEngineConfiguration(dmnEngineConfiguration);
// when the engine is initialized
engine = processEngineConfiguration.buildProcessEngine();
// then the custom listener should be set on the DMN engine
assertThat(getConfigurationOfDmnEngine().getCustomPostDecisionTableEvaluationListeners(), hasItem(customEvaluationListener));
}
示例7: setFeelEngineFactory
import org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration; //导入依赖的package包/类
@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));
}
示例8: setScriptEngineResolver
import org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration; //导入依赖的package包/类
@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));
}
示例9: setElProvider
import org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration; //导入依赖的package包/类
@Test
public void setElProvider() {
// given a DMN engine configuration with el provider
DefaultDmnEngineConfiguration dmnEngineConfiguration = (DefaultDmnEngineConfiguration) DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
ElProvider elProvider = mock(ElProvider.class);
dmnEngineConfiguration.setElProvider(elProvider);
ProcessEngineConfigurationImpl processEngineConfiguration = createProcessEngineConfiguration();
processEngineConfiguration.setDmnEngineConfiguration(dmnEngineConfiguration);
// when the engine is initialized
engine = processEngineConfiguration.buildProcessEngine();
// then the el provider should be set on the DMN engine
assertThat(getConfigurationOfDmnEngine().getElProvider(), is(elProvider));
}
示例10: setDmnEngineConfigurationOverXmlConfiguration
import org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration; //导入依赖的package包/类
@Test
public 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.getDmnEngineConfiguration();
assertThat(dmnEngineConfiguration, is(notNullValue()));
assertThat(dmnEngineConfiguration.getDefaultInputExpressionExpressionLanguage(), is("groovy"));
// when the engine is initialized
engine = processEngineConfiguration.buildProcessEngine();
// then the default expression language should be set in the DMN engine
assertThat(getConfigurationOfDmnEngine().getDefaultInputExpressionExpressionLanguage(), is("groovy"));
}
示例11: getGlobalExpressionLanguage
import org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration; //导入依赖的package包/类
protected static String getGlobalExpressionLanguage(DmnElementTransformContext context) {
String expressionLanguage = context.getModelInstance().getDefinitions().getExpressionLanguage();
if (!DefaultDmnEngineConfiguration.FEEL_EXPRESSION_LANGUAGE.equals(expressionLanguage)) {
return expressionLanguage;
}
else {
return null;
}
}
示例12: DecisionTableEvaluationHandler
import org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration; //导入依赖的package包/类
public DecisionTableEvaluationHandler(DefaultDmnEngineConfiguration configuration) {
expressionEvaluationHandler = new ExpressionEvaluationHandler(configuration);
feelEngine = configuration.getFeelEngine();
evaluationListeners = configuration.getDecisionTableEvaluationListeners();
inputExpressionExpressionLanguage = configuration.getDefaultInputExpressionExpressionLanguage();
inputEntryExpressionLanguage = configuration.getDefaultInputEntryExpressionLanguage();
outputEntryExpressionLanguage = configuration.getDefaultOutputEntryExpressionLanguage();
}
示例13: shouldCreateDefaultEngineConfiguration
import org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration; //导入依赖的package包/类
@Test
public void shouldCreateDefaultEngineConfiguration() {
DmnEngineConfiguration configuration = DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
assertThat(configuration)
.isInstanceOf(DefaultDmnEngineConfiguration.class)
.isNotNull();
}
示例14: getDmnEngineConfiguration
import org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration; //导入依赖的package包/类
@Override
public DmnEngineConfiguration getDmnEngineConfiguration() {
DefaultDmnEngineConfiguration configuration = new DefaultDmnEngineConfiguration();
configuration.setScriptEngineResolver(createScriptEngineResolver());
configuration.setElProvider(createElProvider());
return configuration;
}
示例15: createEngineWithDefaultExpressionLanguage
import org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration; //导入依赖的package包/类
protected DmnEngine createEngineWithDefaultExpressionLanguage(String expressionLanguage) {
DefaultDmnEngineConfiguration configuration = (DefaultDmnEngineConfiguration) getDmnEngineConfiguration();
configuration.setDefaultInputExpressionExpressionLanguage(expressionLanguage);
configuration.setDefaultInputEntryExpressionLanguage(expressionLanguage);
configuration.setDefaultOutputEntryExpressionLanguage(expressionLanguage);
configuration.setDefaultLiteralExpressionLanguage(expressionLanguage);
return configuration.buildEngine();
}