The Decision Model and Notation (DMN) standard is changing the practice of decision modeling and management. Up to now, it has primarily been used to define model-based decision requirements handed off to developers for implementation in some other rule language. DMN is good for that, and actually most tools that claim to support DMN cannot do any more than that.
But DMN is much more than a language for defining business requirements. It is a full-featured decision language that can create directly executable decision services with the richness and scalability demanded by real-world decision logic. At the same time, the language was intended to be business-friendly. Decision logic design is graphical, not program code. DMN’s diagrams and tables called boxed expressions, in combination with FEEL, the expression language used in the table cells, can handle the full range of decision logic used with traditional rule engines. And today we have tools that can actually do this: Trisotech on the modeling side and Drools 7 for the runtime. So there is no longer any need for modelers to hand off DMN for translation to Java, ODM, or some other foreign rule language.
Business-friendliness notwithstanding, it’s going to be developers that flesh out executable DMN solutions, and DMN Cookbook was written for them. My co-author Edson Tirelli is the Drools project lead at Red Hat and creator of the DMN runtime used by Trisotech, Red Hat, and other DMN tool vendors. In the cookbook style of other technical books, we present over 50 recipes illustrating DMN solutions to common problems facing decision logic developers, from manipulating strings, numbers, date/times, and lists to table queries and joins, iteration, recursion, and set operations. It also shows how to incorporate Java static and non-static methods, deploy DMN models as REST services, and invoke those services from a variety of clients, including Java, a BPMN process, and Microsoft Flow. Extended examples cover data validation, handling logic variations using either a central registry, dynamic composition, or static composition, a DMN-enhanced blockchain Smart Contract, and state chart-based pattern recognition. Each recipe includes a problem statement, a complete illustrated solution including DRD, boxed expressions, FEEL code and test case data, and discussion of the issues involved. Some examples illustrate multiple approaches: DMN 1.1 FEEL, DMN 1.2 FEEL, Java, and Drools extensions. All examples are explained and downloadable for editing and execution using Trisotech DMN Modeler.