当前位置: 首页>>代码示例>>Java>>正文


Java DefaultDmnEngineConfiguration类代码示例

本文整理汇总了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));
  }
}
 
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:18,代码来源:FeelIntegrationTest.java

示例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));
  }
}
 
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:18,代码来源:FeelIntegrationTest.java

示例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));
}
 
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:17,代码来源:FeelIntegrationTest.java

示例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));
}
 
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:17,代码来源:FeelIntegrationTest.java

示例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);
}
 
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:23,代码来源:ExpressionCachingTest.java

示例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));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:DmnEngineConfigurationTest.java

示例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));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:17,代码来源:DmnEngineConfigurationTest.java

示例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));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:17,代码来源:DmnEngineConfigurationTest.java

示例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));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:17,代码来源:DmnEngineConfigurationTest.java

示例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"));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:DmnEngineConfigurationTest.java

示例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;
  }
}
 
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:10,代码来源:DmnExpressionTransformHelper.java

示例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();
}
 
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:11,代码来源:DecisionTableEvaluationHandler.java

示例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();
}
 
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:8,代码来源:DmnEngineConfigurationApiTest.java

示例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;
}
 
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:10,代码来源:ExpressionLanguageTest.java

示例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();
}
 
开发者ID:camunda,项目名称:camunda-engine-dmn,代码行数:11,代码来源:ExpressionLanguageTest.java


注:本文中的org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。