Search in sources :

Example 1 with DecisionDefinitionHandler

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

the class DmnEngineConfigurationBuilder method build.

/**
 * Modify the given DMN engine configuration and return it.
 */
public DefaultDmnEngineConfiguration build() {
    List<DmnDecisionEvaluationListener> decisionEvaluationListeners = createCustomPostDecisionEvaluationListeners();
    dmnEngineConfiguration.setCustomPostDecisionEvaluationListeners(decisionEvaluationListeners);
    // override the decision table handler
    DmnTransformer dmnTransformer = dmnEngineConfiguration.getTransformer();
    dmnTransformer.getElementTransformHandlerRegistry().addHandler(Definitions.class, new DecisionRequirementsDefinitionTransformHandler());
    dmnTransformer.getElementTransformHandlerRegistry().addHandler(Decision.class, new DecisionDefinitionHandler());
    // do not override the script engine resolver if set
    if (dmnEngineConfiguration.getScriptEngineResolver() == null) {
        ensureNotNull("scriptEngineResolver", scriptEngineResolver);
        dmnEngineConfiguration.setScriptEngineResolver(scriptEngineResolver);
    }
    // do not override the el provider if set
    if (dmnEngineConfiguration.getElProvider() == null) {
        ensureNotNull("expressionManager", expressionManager);
        ProcessEngineElProvider elProvider = new ProcessEngineElProvider(expressionManager);
        dmnEngineConfiguration.setElProvider(elProvider);
    }
    return dmnEngineConfiguration;
}
Also used : DecisionDefinitionHandler(org.camunda.bpm.engine.impl.dmn.transformer.DecisionDefinitionHandler) DmnDecisionEvaluationListener(org.camunda.bpm.dmn.engine.delegate.DmnDecisionEvaluationListener) DecisionRequirementsDefinitionTransformHandler(org.camunda.bpm.engine.impl.dmn.transformer.DecisionRequirementsDefinitionTransformHandler) ProcessEngineElProvider(org.camunda.bpm.engine.impl.dmn.el.ProcessEngineElProvider) DmnTransformer(org.camunda.bpm.dmn.engine.impl.spi.transform.DmnTransformer)

Aggregations

DmnDecisionEvaluationListener (org.camunda.bpm.dmn.engine.delegate.DmnDecisionEvaluationListener)1 DmnTransformer (org.camunda.bpm.dmn.engine.impl.spi.transform.DmnTransformer)1 ProcessEngineElProvider (org.camunda.bpm.engine.impl.dmn.el.ProcessEngineElProvider)1 DecisionDefinitionHandler (org.camunda.bpm.engine.impl.dmn.transformer.DecisionDefinitionHandler)1 DecisionRequirementsDefinitionTransformHandler (org.camunda.bpm.engine.impl.dmn.transformer.DecisionRequirementsDefinitionTransformHandler)1