Bruce Silver / Edson Tirelli
Decision Model and Notation (DMN), the new standard for business decision modeling, is changing the methodology of business rules projects. While its Decision Requirements Diagrams (DRDs) and decision tables can be used to create business requirements handed off to programmers in a traditional rule language, DMN is actually a complete rule language shared by business and IT. Its various boxed expressions and FEEL expression language allow programmers and technically oriented modelers to create complex decision models directly executable on a DMN engine such as Drools/Red Hat Decision Manager. DMN Cookbook explains how the DMN language works and how it differs from traditional rule languages. It goes on to provide 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.