Blog Posts

DMN 1.1 XML: from modeling to automation with Drools 7.0

Blog: Drools & jBPM Blog

I am a freelance consultant, but I am acting today as a PhD student. The global context of my thesis is Enterprise Architecture (EA), which requires to model the Enterprise. As one aspect of EA is business process modeling, I am using BPMN from years, but this notation is not very appropriate to represent decision criteria: a cascade of nested gateways becomes quickly difficult to understand then to modify. So, when OMG published the first version 1.0 Beta of DMN specification in 2014, I found that DMN was a very interesting notation to model decision-making. I succeeded in developing my own DMN modeling tool, based on DMN metamodel, in using the Sirius plugin for Eclipse . But even the next “final” version 1.0 of DMN specification was not very accomplished.

The latest version 1.1 of DMN, published in June 2016, is quite good. In the meantime, software editors (at least twenty) have launched good modeling tools, as Signavio Decision Manager (free for Academics) used for this article. This Signavio tool was already able to generate specific DRL files for running DMN models on the BRMS Drools current version 6. In addition to the graphics, some editors added recently the capability to export DMN models (diagram & decision tables) into “DMN 1.1 XML” files, which are compliant with the DMN specification. And the good news is that BRMS like Drools (future version 7, available in Beta version) are able to run theses DMN XML files for automating decision-making (a few lines of Java code are required to invoke theses high level DMN models).

This new approach of treating “DMN 1.1 XML” interchange model directly is better for tool independency and model portability. Here is a short comparison between the former classic but specific solution and this new and generic solution, using the tool Signavio Decision Manager (latest version 10.13.0). MDA (Model Driven Architecture) and its three models CIM, PIM & PSM gives us the appropriate reading grid for this comparison:

3 MDA models

Description

Classic specific DMN solution
from Signavio Decision Manager
to BRMS Drools

CIM (Computation
Independent Model)

Representation model for business,
independent of computer considerations

DRD (Decision Requirements Diagram)
+ Decision Tables

PIM (Platform
Independent Model)

Design model for computing,
independent of the execution platform

û

PSM (Platform
Specific Model)

Design model for computing,
specific to the execution platform

DRL (Drools Rule Language)
+ DMN Formulae Java8-1.0-SNAPSHOT.jar

The visible aspect of DMN is its emblematic Decision Requirements Diagram (DRD) which can be completed with some Decision Tables for representing the business logic for decision-making. A DRD and its Decision Tables compose a CIM model, independent of any computer considerations.

Then, in the classic but specific DMN solution, Signavio Decision Manager is able, from a business DMN model (DRD diagram and Decision Tables), to export a DRL file directly for a Drools rules engine. So, this solution skips the intermediate PIM level, that is not very compliant with MDA concept. Note that this DRL file needs a specific Signavio’s jar library with DMN formulae.

3 MDA models

Description

New generic DMN solution
from Signavio Decision Manager(or other tools)
to BRMS Drools (or other BRMS)

CIM (Computation
Independent Model)

Representation model for business,
independent of computer considerations

DRD (Decision Requirements Diagram)
+ Decision Tables

PIM (Platform
Independent Model)

Design model for computing,
independent of the execution platform

DMN 1.1 XML (interchange model)
containing FEEL Expressions

PSM (Platform
Specific Model)

Design model for computing,
specific to the execution platform

û

The invisible aspect of DMN is its DMN XML interchange model, very useful for exchanging a model between modeling tools. DMN XLM is also very useful for going from model to automation. DMN XML model takes into account computer considerations, but as it is defined into DMN specification, a standard published by OMG (Object Management Group), it is independent of any execution platform, so it is a PIM model. DMN XML complies to DMN metamodel and can be checked with an XSD schema provided by OMG. The latest version 1.1 of DMN has refined this DMN XML format.

As DMN is a declarative language, a DMN XML file contains essentially declarations. The business logic included can be expressed with FEEL (Friendly Enough Expression Language) expressions. All entities required for a DMN model (input data, decision tables, rules, output decisions, etc.) are exported into the DMN XML file, due to a mechanism called serialization. It is why automation is now possible from DMN XML directly. Not all DMN modeling tools allow to export (or import) to DMN XML format.


With the new generic DMN solution, Signavio Decision Manager is now able, from the same business DMN model (DRD diagram and decision tables), to export “DMN 1.1 XML” interchange model. As the future 7.0.0 version of Drools is able to interpret “DMN 1.1 XML” format directly, the last level PSM, specific to the execution platform, is not useful anymore.

The new generic DMN solution, without skipping PIM level, sounds definitely better than the specific one and is a good basis for automating decision-making. Another advantage is, as Signavio said, that this new approach using “DMN 1.1 XML” reduces the vendor lock-in.



Thierry BIARD

Leave a Comment

Get the BPI Web Feed

Using the HTML code below, you can display this Business Process Incubator page content with the current filter and sorting inside your web site for FREE.

Copy/Paste this code in your website html code:

<iframe src="https://www.businessprocessincubator.com/content/dmn-1-1-xml-from-modeling-to-automation-with-drools-7-0/?feed=html" frameborder="0" scrolling="auto" width="100%" height="700">

Customizing your BPI Web Feed

You can click on the Get the BPI Web Feed link on any of our page to create the best possible feed for your site. Here are a few tips to customize your BPI Web Feed.

Customizing the Content Filter
On any page, you can add filter criteria using the MORE FILTERS interface:

Customizing the Content Filter

Customizing the Content Sorting
Clicking on the sorting options will also change the way your BPI Web Feed will be ordered on your site:

Get the BPI Web Feed

Some integration examples

BPMN.org

XPDL.org

×