Tuesday, March 21, 2017

DMN 1.1 XML: from modeling to automation with Drools 7.0

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 (at the beginning of my thesis), 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, in fact.

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 now, the good news is that BRMS like Drools (future version 7, already available in Beta version) are able to run theses DMN 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. This 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

So, 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
û

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, which is a PIM, independent of the execution platform. 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.

Share/Bookmark

Sunday, March 12, 2017

DroolsJBPM organization on GitHub to be renamed to KieGroup


   In preparation for the 7.0 community release in a few weeks, the "droolsjbpm" organization on GitHub will be renamed to "kiegroup". This is scheduled to happen on Monday, March 13th.

   While the rename has no effect on the code itself, if you have cloned the code repository, you will need to update your local copy with the proper remote URL changing it from:


   To:


   Unfortunately, the URL redirect feature in GitHub will not support this rename, so you will likely have to update the URL manually on your local machines.

   Sorry for the inconvenience. 

Share/Bookmark

Thursday, February 02, 2017

AI Engineer - Entando are Hiring

Entando are looking to hire an AI Engineer, in Italy, to work closely with the Drools team building a next generation platform for integrated and hybrid AI. Together we'll be looking at how we can build systems that leverage and integrate different AI paradigms for the contextual awareness domain - such as enhancing our complex event processing,  building fuzzy/probability rules extensions or looking at Case Based Learning/Reasoning to help with predictive behavioural automation.

The application link can be found here.

Share/Bookmark

Drools & jBPM are Hiring

The Drools and jBPM team are looking to hire. The role requires a generalist able work with both front-end and back-end code. We need a flexible and dynamic person who is able to handle what ever is thrown at them and relishes the challenge of learning new things on the fly. Ideally, although not a requirement, you'll be able to show some contributions to open source projects. You'll work closely with some key customers implementing their requirements in our open source products.

This is a remote role, and we can potentially hire in any country there is a Red Hat office, although you may be expected to do very occasional travel to visit clients.

The application link for the role can be found here:

Mark

Share/Bookmark

Sunday, January 08, 2017

DMN runtime example with Drools

As announced last year, Drools 7.0 will have full runtime support for DMN models at compliance level 3.

The runtime implementation is, at the time of this blog post, feature complete and the team now is working on nice to have improvements, bug fixes and user friendliness.

Unfortunately, we will not have full authoring capabilities in time for the 7.0 release, but we are working on it for the future. The great thing about standards, though, is that there is no vendor lock-in. Any tool that supports the standard can be used to produce the models that can be executed using the Drools runtime engine. One company that has a nice DMN modeller is Trisotech, and their tools work perfectly with the Drools runtime.

Another great resource about DMN is Bruce Silver's website Method & Style. In particular I highly recommend his book for anyone that wishes to learn more about DMN.

Anyway, I would like to give users a little taste of what is coming and show one example of a DMN model and how it can be executed using Drools.

The Decision Management Community website periodically publishes challenges for anyone interested in trying to provide a solution for simple decision problems. This example is my solution to their challenge from October/2016.

Here are the links to the relevant files:

* Solution explanation and documentation
* DMN source file
* Example code to execute the example

I am also reproducing a few of the diagrams below, but take a look at the PDF for the complete solution and the documentation.

Happy Drooling!






Share/Bookmark

Saturday, December 17, 2016

Introducing Drools Fiddle

Drools Fiddle is the fiddle for Drools. Like many other fiddle tools, Drools Fiddle allows both technical and business users to play around with Drools and aims at making Drools accessible to everyone. 



The entry point to Drools Fiddle is the DRL editor (top left panel), which allows to define and implement both fact models and business rules, using the Drools Rule Language. Once the rules are defined, they can be compiled into a KieBase by clicking on the Build button.

If the KieBase is successfully built, the visualization panel on the right will visualize the fact types as well as the rules as graph nodes. For instance, this DRL will be displayed as follows:



declare MyFactType
    value : int
end


rule "MyRule"
when
   f : MyFactType(value == 42)
then
   modify( f ) {setValue( 41 )}

end



All the actions that are performed on the working memory will be represented by arrows in this graph. The purpose of the User icon is to identify all the actions performed directly by the user. 

For example, let's see how we can dynamically insert fact instances into the working memory. After the KieBase compilation, the Drools Facts tab is displayed on the left:




This form allows you to create instances of the fact types that have been previously declared in the DRL. For each instances inserted in the working memory a blue node will be displayed in the Visualization tab. The arrow coming from the User icon shows that this action was performed manually by the user.

Once your working memory is ready, you can trigger the fireAllRules method by clicking on the Fire button. As a result, all the events occurring in the engine: rule matching, fact insertion/update/deletion are displayed in the visualization tab.
In the above example, we can see that the fact inserted by the user in step 1 triggered the rule "MyRule" which in turn modified the value of the fact from 42 to 41.

Some additional features have been implemented in order to enhance the user experience: 
  • Step by step debugging of the engine events.
  • Persistence: the Save button associates a unique URI to a DRL snippet in order to share it with the community, e.g.: http://droolsfiddle.tk/#/VYxQ4rW6
So far, only the minimum set of functionalities have been implemented to showcase the Drools Fiddle concept but there are still a lot of exciting features in the pipe:

  • Multi tabbed DRL editor
  • Decision  table support
  • Sequence diagram representation of rule engine events
  • Fact history visualization
  • Improvement of log events visualization
  • KieSession persistence to resume stateful sessions
  • Integration within Drools Workbench
The source code of Drools Fiddle is available on GitHub under Apache v2 License and you can access the application at http://droolsfiddle.tk. Should you wish to contribute, pull requests are welcome ;)

We would love to have the feedback of the Drools community in order to improve the fiddle and make it evolve in the right direction.

by Julien Vipret & Matteo Casalino

Share/Bookmark

Monday, December 05, 2016

New 6.5.0.Final tags for community Docker images

The latest Docker community image tags for 6.5.0.Final are now available on Docker Hub.

More information at the following links:


Share/Bookmark

Friday, November 11, 2016

Red Hat BRMS and BPMS Roadmap Presentation (Nov 22nd, London)

Original Link :  http://www.c2b2.co.uk/red_hat_brms_and_bpms_roadmap_presentation

Featuring Drools, jBPM, OptaPlanner, DashBuilder, UberFire and Errai
For our second JBUG this November we’re delighted to welcome back Red Hat Platform Architect, Mark Proctor who will be part of a panel of speakers presenting roadmap talks on each component technology.
We’re fortunate to have this opportunity for so many project leads to be in one room at the same time, and it’s a fantastic opportunity to come along and ask questions about the future plans for BRMS and BPMS.
The talk will look at how the 7 series is shifting gears, presenting a vision for low-code application development in the cloud - with a much stronger focus on quality and maturity over previous releases.
Key topics will include:
  • The new Rich Client Platform
  • The new BPMN2 Designer
  • New Case Management and Modelling
  • Improved Advanced Decision Tables and new Decision Model Notation
  • Improved Forms and Page building
  • Fully integrated DashBuilder reporting
  • New OptaPlanner features & performance improvements
There will be opportunities for questions and the chance to network with the team over a beer and slice of pizza.
Registration
Attendees must register at the Skills Matter website prior to the meet-up. Please – only register if you intend to come along. Follow this link to register: https://skillsmatter.com/meetups/8489-jboss-november-meetup.
Agenda
18:30 – 18:45     Meet up at Skills Matter with a beer at the bar
18:45 – 19:45     Part One
19:45 – 20:00     Refreshment break
20:00 – 20:30     Part Two
20:30                    Pizza, beer and networking
Speakers
Mark Proctor
Mark is a Red Hat Platform Architect and co-creator of the Drools project - the leading Java Open Source rules system. In 2005 Mark joined JBoss as lead of the Drools project. In 2006, when Red Hat acquired JBoss, Mark’s role evolved into his current position as platform architect for the Red Hat JBoss BRMS (Business Rules Management System) and BPMS (Business Process Management System) platforms - which incorporate the Drools and jBPM projects.
Kris Verlaenen
Kris is the JBoss BPM project lead, and is interested in pretty much everything related to business process management. He is particularly fascinated by healthcare - an area that has already demonstrated the need for flexible business processes.
Geoffrey De Smet
Geoffrey is the founder and project lead of OptaPlanner (http://www.optaplanner.org), the leading open source constraint satisfaction solver in Java. He started coding Java in 1999, regularly participates in academic competitions, and enjoys assisting developers in optimizing challenging planning problems of real-world enterprises. He is also a contributor to a variety of other open source projects.
Mauricio Salatino
Mauricio Salatino is a Drools/jBPM Senior Software Engineer in Red Hat, and author of the jBPM5 and jBPM Developer Guide, and the Drools 6 Developer Guide. His main task right now is to develop the next generation cloud capability for the BRMS and BPMS platforms - which includes the Drools and jBPM technologies.
Max Barkley
Max is a Software Engineer at Red Hat and the Errai project lead. Joining Red Hat as an intern in 2013, he took on his current role after graduating H.B.Sc. Mathematics from the University of Toronto in 2015.

Share/Bookmark

Monday, October 31, 2016

Drools 7 to support DMN (Decision Model and Notation)

The Decision Model and Notation (DMN) specification is a relatively new standard by OMG (Object Management Group) that aims to do for business rules and business decisions what BPMN (it's sibling specification) did for business processes: standardize the notation and execution semantics to enable both its use by business users, and the interchange of models between tools from different vendors.

The Drools team has been actively following the specification and the direction it is taking. The team believes that, in accordance with its long time commitment to open standards, it is now time to support the specification and provide a compliant implementation for the benefit of its users.

The specification defines among other things:


  1. an expression language called FEEL used to express constraints and decisions
  2. a graphical language to model decision requirements
  3. a metamodel and runtime semantics for decision models
  4. an XML-based interchange format for decision models


As part of the investigation, the Drools team implemented a PoC that is now public and available here. The PoC already covers:


  • a complete, compliance level 3, FEEL language implementation.
  • complete support for the XML-based interchange format for marshalling and unmarshalling.
  • A partial implementation of the metamodel and runtime semantics 

We expect to have a complete runtime implementation released with Drools 7.0 (expected for Q1/2017).

On a related note, this is also a great opportunity for community involvement. This being a standard implementation, and relatively isolated from other existing components, it is the perfect chance for any community member that wishes to get involved with Drools and open source development to get his/her hands dirty and help bring this specification to life. Contact me on the Drools mailing list or on IRC if you would like to help.

We will publish over the next few weeks several blogs on this subject, with both general explanations about the specification and with details of our plans and our implementation. Bellow you can find a quick Q&A. Feel free to ask additional questions you might have about this subject on the mailing list.

Happy Drooling!

Questions & Answers


1. What DMN version and what compliance level will Drools support?

Drools is implementing DMN version 1.1 support at compliance level 3.

2. Is DMN support integrated with the Drools platform?

Yes, the DMN implementation leverages the whole Drools platform (including, among other things, the deployment model, infrastructure and tooling). DMN models are a first class citizen in the platform and an additional asset that can be included in kjars. DMN models will be supported in the kie-server and decision services exposed via the usual kie-server interfaces.

3. Is Drools DMN integrated with jBPM BPMN?

At the moment of this announcement, the integration is not implemented yet, but we expect it will be fully functional by the time Drools and jBPM 7.0 release (Q1 2017).

4. Will FEEL be a supported dialect for DRL rules? 

At the moment this is not clear and requires additional research. While FEEL works well as part of the XML-based interchange format, its syntax (that supports spaces and special characters as part of identifiers) is ambiguous and cannot be easily embedded into another language like DRL. We will discuss this topic further in the upcoming months.


Share/Bookmark

Tuesday, October 25, 2016

Drools 6.5.0.Final is available

The latests and greatest Drools 6.5.0.Final release is now available for download.

This is an incremental release on our previous build that focus on a few key improvements to round up the 6.x series.

You can find more details, downloads and documentation here:

Read below some of the highlights of the release.

You can also check the new releases for:
Happy drooling.

What's new?

Core Engine

Configurable ThreadFactory 


Some runtime environments (like for example Google App Engine) don't allow to directly create new Threads. For this reason it is now possible to plug your own ThreadFactory implementation by setting the system property drools.threadFactory with its class name.

Use of any expressions as input for a query 


It is now possible to use as input argument for a query both the field of a fact as in:

query contains(String $s, String $c)
    $s := String( this.contains( $c ) )
end

rule PersonNamesWithA when
    $p : Person()
    contains( $p.name, "a"; )
then
end 

Update with modified properties 

Property reactivity has been introduced to avoid unwanted and useless (re)evaluations and allow the engine to react only to modification of properties actually constrained or bound inside of a given pattern. However this feature is automatically available only for modifications performed inside the consequence of a rule. Conversely a programmatic update is unaware of the object’s properties that have been changed, so it is unable of using this feature.

To overcome this limitation it is now possible to optionally specify in an update statement the names of the properties that have been changed in the modified object as in the following example:

Person me = new Person("me", 40);
FactHandle meHandle = ksession.insert( me );

me.setAge(41);
me.setAddress("California Avenue");
ksession.update( meHandle, me, "age", "address" ); 

Monitoring framework improvements 

A new type of MBean has been introduced in order to provide monitoring of the KieContainers, and the JMX MBeans hierarchical structure have been revisited to reflect the relationship with the related MBeans of the KieBases. The JMX objectnaming has been normalized to reflect the terminology used in the Kie API.A new type of MBean has been introduced in order to provide monitoring for Stateless KieSession, which was not available in previous releases.

Drools Workbench

Guided Rule Editor : Support formulae in composite field constraints 

Composite field constraints now support use of formulae. When adding constraints to a Pattern the "Multiple Field Constraint" selection ("All of (and)" and "Any of (or)") supports use of formulae in addition to expressions.

Authoring - Project Editor - Reimport button 

The "Reimport" button invalidates all cached dependencies, in order to handle scenarios where a specific dependency was updated without having its version modified.
Share/Bookmark