camunda-engine-dmn artifact to the classpath of the application and then
configure and build a decision engine instance. This section provides the
required maven coordinates to add the DMN engine as a dependency to your
project. It then shows how to configure and build a new DMN engine instance.
Maven Coordinates
The ASEE Flow DMN engine is released to Maven Central. Start by importing thecamunda-engine-dmn BOM
to ensure correct dependency management.
Next, include the camunda-engine-dmn
artifact in the dependencies section.
Building a DMN Engine
To build a new DMN engine, create a DMN engine configuration. Configure it as needed and then build a new DMN engine from it.Configuration of the DMN Engine
This section gives more insights of embedded DMN engine configuration. In case you want to use DMN engine as part of the BPMN engine, please refer to the DMN Engine Configuration section of the User Guide for the configuration in that scenario.Decision Table Evaluation Listeners
The DMN engine configuration allows you add a custom decision table evaluation listener. A decision table evaluation listener is notified after a decision table has been evaluated. It receives an evaluation event which contains the result of the evaluation. You can decide if the listener should be notified before or after the default listeners.Decision Evaluation Listeners
The DMN engine configuration allows you add a custom decision evaluation listener. A decision evaluation listener is notified after a decision with all the required decisions has been evaluated. It receives an evaluation event which contains the result of the evaluation. You can decide if the listener should be notified before or after the default listeners.Customizing and Extending the DMN Engine
The default DMN engine configuration has further customization and extension points.Customize DMN Transformation
It is possible to customize the transformation of DMN by providing a DMN transformer or configuring the default one.Register DMN Transform Listeners
The simplest customization is to provide a transform listener. The Listener is notified after a DMN element is transformed. The listener can modify the transformed object.Register DMN Element Transform Handler
While the transform listener allows modifying of the transformed objects, it does not support instantiating custom subclasses. This can be achieved using a custom transform handler. A transform handler is registered for a given [DMN model API] type like aDecisionTable.
First, implement a transform handler which can transform a decision table.
Register DMN Data Type Transformers
The DMN engine supports a set of built-in [data types]. It is possible to override existing types with new types. Assume you want to support a local date format type. To achieve this, override the existing date transformer by implementing a custom transformer:Register Hit Policy Handlers
The DMN engine supports a subset of the DMN 1.3 [hit policies]. It is possible to implement new hit policies or override an existing hit policy implementation.Change default expression languages
A [DMN decision table] has multiple expressions which are evaluated when the table is executed. The default expression language for every expression type can be configured. The following expression types exist:- Input Expression: Used to specify the input of a column in a decision
table. The default language for input expressions in the DMN engine is
FEEL. - Input Entry: Used to specify the condition of a rule in a decision
table. The default language for input entries in the DMN engine is
FEEL. - Output Entry: Used to specify the output of a rule in a decision
table. The default language for output entries in the DMN engine is
FEEL.
FEEL.
Read more about the default expressions in the corresponding [section][expressions].
It is possible to change the default expression language on the DMN engine configuration:
JUEL and FEEL are available.
If the JDK includes a JavaScript
implementation like Rhino or Nashorn, then javascript is available as well.
It is also possible to use other script languages like groovy, python or ruby.
Just make sure that the corresponding libraries are available on the classpath at runtime.
Customize Expression and Script Resolving
The default DMN engine resolves the supported expression and script languages using different providers. To evaluateJUEL expressions, the DMN engine uses the ElProvider configured in the
DMN engine configuration. To use another implementation of the Unified Expression Language, replace this implementation.
FEEL engine used you can provide a custom FeelEngineFactory.
Logging
The DMN engine uses [SLF4J] as logging API. Thecamunda-dmn-engine artifact
does not have a dependency to any of the existing [SLF4J] backends. This means that
you can choose which backend you want to use. One example would be [LOGBack], or
if you want to use Java util logging, you could use the slf4j-jdk14 artifact.
For more information on how to configure and use SLF4J, please refer to the
[user manual].
[evaluation listener]: DmnDecisionTableEvaluationListener Interface
[DMN model API]: https://github.com/camunda/camunda-dmn-model
[data types]: /user-guide/dmn-engine/data-types
[hit policies]: /reference/dmn/decision-table/hit-policy
[SLF4J]: http://www.slf4j.org/
[LOGBack]: http://logback.qos.ch/
[user manual]: http://www.slf4j.org/manual.html
[DMN decision table]: /reference/dmn/decision-table
[DMN decision literal expression]: /reference/dmn/decision-literal-expression
[expressions]: /user-guide/dmn-engine/expressions-and-scripts