當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。