Author: Bruce Silver
Publisher: Cody-Cassidy Press
Publication Date: January 2024
Pages: 312

Overview

It’s been over five years since the publication of DMN Method and Style, 2nd Edition, and much has changed since then. This new edition is based on the draft DMN 1.6 specification, which introduces many features that were unavailable in the second edition, which was based on DMN 1.2. This edition provides a comprehensive guide to the language and many practical examples, with 271 diagrams and tables.

While the previous edition was primarily targeted at business users, the new edition balances the needs of both business and technical modelers.

Using a combination of logic decomposition diagrams (DRDs), standard tabular formats (boxed expressions), and the Low-Code expression language FEEL, DMN allows subject matter experts to automate the operational decisions that drive the business. More powerful and business-friendly than Microsoft Power FX, DMN is used by both business and technical modelers to create, test, and deploy cloud-based decision services.

Part I, the Guide to Decision Modeling. This business-oriented section explains the creation and use of Decision Requirements Diagrams (DRDs), decision tables, and all the tabular boxed expression types, as well as a deep dive into all the FEEL functions and operators.

Part II, the DMN Cookbook. This technically oriented section, which was previously a separate volume, offers “recipes” for various modeling challenges. Reflecting on the original DMN Cookbook, the edition is updated to DMN 1.5/1.6, with solutions to over 40 modeling challenges.

Another motivation for this new edition comes from the author’s own experience in DMN engagements. Seemingly obscure aspects of FEEL—such as double iteration, handling lists of lists, interpolation of published data, and complex data validation—can be critical in real-world projects, and these elements have all been incorporated into the new edition.

Key Learning Objectives

In this book, you will learn the following aspects of DMN: 

  • Logic decomposition with Decision Requirements Diagrams (DRDs) 
  • Decision Table hit Policy and Decision Table Analysis 
  • Low-Code logic design using standard tabular formats called boxed expressions 
  • User-defined functions, known as Business Knowledge Models (BKMs) 
  • FEEL, a powerful yet business-friendly expression language for formulas in table cells
  • Contexts, a boxed expression type that simplifies FEEL expressions
  • Testing logic by executing it in the tool
  • Defining and publishing decision services for execution by external clients 

Topics include:

  • What is DMN?
  • DMN by Example
  • Hit Policy and Decision Table Analysis
  • Feel Variables and Types
  • Feel Literal Expressions
  • Business Knowledge Models
  • Context
  • Calendar Arithmetic
  • List and Tables
  • Input data validation
  • Certification and Next Steps

Preface

Decision Model and Notation (DMN) is a model-based language designed for decision automation. “Model-based” implies that it utilizes diagrams and tables rather than program code, making it accessible not only to programmers but also to subject matter experts in business sectors. In contemporary terms, DMN qualifies as a Low-Code language, appealing to solution “makers” across both business and IT domains. Low-Code solutions are known for their rapid design and deployment capabilities, offering a solution to the well-known bottleneck caused by programming demands.

Furthermore, DMN is an open standard maintained by the Object Management Group (OMG), ensuring it is vendor-neutral, and its intellectual property is freely available for use. DMN facilitates the creation of decision models that graphically depict the logical structure of business decisions, termed decision requirements, alongside their executable decision logic, which includes the rules and formulas for each model element. This graphical approach to design enhances transparency and maintainability of the model logic for business users.

Structure of the Book

Part 1: Guide to Decision Modeling

This section largely follows the DMN Method and Style training.

Chapter 1: What Is DMN? The Author begins by demonstrating a decision model through an example, providing a concrete understanding of how various elements are utilized to model and execute a decision. The chapter then outlines the key benefits of model-based decision automation.

Chapter 2: DMN Elements. This chapter explains each of the core building blocks of DMN, including the decision requirements diagram (DRD), the metamodel and schema, decision tables and other boxed expressions, and DMN’s standard expression language, FEEL. The chapter concludes with a review of DMN’s essential characteristics.

Chapter 3: Decision Requirements. Here, the focus is on DRD and the mechanics of creating it.

Chapter 4: Decision Tables. This chapter covers DMN’s most familiar boxed expression type—the decision table—including what is permitted in each cell and how the table output value is selected. It explains various hit policies, when to use each one, and best practice conventions with decision tables, many of which can be validated using tool-based Decision Table Analysis.

Chapter 5: Data Modeling and Reuse. The Author explains the importance and mechanics of assigning datatypes to process variables. This chapter explores how the internal data language, FEEL, relates to externally defined data submitted to DMN at execution time, particularly XML and JSON, and the use of the special FEEL value null. It further explains how the logical data model defined by DMN can be linked to conceptual data models defined outside of DMN to provide unambiguous meanings to key business terms.

Chapter 6: Literal Expressions. This chapter begins the explanation of DMN’s expression language, FEEL. It includes a complete discussion of formulas involving built-in String and Number functions and how expressions are nested within other expressions.

Chapter 7: Business Knowledge Models (BKMs). The Author discusses the importance and benefits of these modeler-defined logic functions, their definition, and the two ways to invoke them. The chapter also explains how BKMs can be used to call external functions and how libraries of commonly used functionality can be maintained for consistent reuse across multiple process models.

Chapter 8: Contexts. This chapter explains how this boxed expression type is used to simplify complex literal expressions without adding extra elements to the DRD. It also demonstrates how contexts are used to create structured values, such as rows in a table.

Chapter 9: Decision Services. This chapter details how units of model execution, known as decision services, are defined and invoked. It explains the differences between a decision service and a BKM, especially in the context of invocation by an external client application, process, or another decision in DMN.

Chapter 10: Calendar Arithmetic. Here, the Author explains how DMN handles dates, times, and durations, and how these elements are used in decision logic. The chapter also discusses FEEL’s recently added Temporal Logic functions.

Chapter 11: Lists and Tables. This chapter delves into some of DMN’s most useful capabilities, including creating lists or tables, querying tables using filters, joining related tables, iterating over a list or table, and performing set operations.

Chapter 12: Data Validation. The Author discusses an issue often overlooked by beginners but crucial in real projects—checking that data submitted to a decision service at execution time is complete and valid. Various methods for FEEL to check for missing or invalid data are explained, followed by a discussion of four different ways to implement data validation and when to use each one.

Chapter 13: Orchestrating DMN. This chapter discusses how decision services are integrated with BPMN and CMMN to define a sequence of decisions and related actions.

Part 2: DMN Cookbook

This section is organized as a collection of recipes that illustrate the use of DMN in a wide variety of modeling tasks.

Chapter 14: About the DMN Cookbook. The Author explains how FEEL is more powerful and business-friendly than Microsoft’s Low-Code expression language, Power FX. The chapter also provides a brief discussion of one of FEEL’s most powerful but controversial features—recursion.

Chapter 15: String Recipes. This chapter discusses string-related tasks such as casting to a string, handling null values, parsing strings, joining a collection of strings, formatting numeric and date strings, and using regular expressions.

Chapter 16: Calendar Arithmetic Recipes. The Author provides additional examples of calculations involving dates, times, and durations.

Chapter 17: List and Table Recipes. This chapter presents more complex examples, including iteration over item indices and sorting using a named precedes function.

Chapter 18: Math Recipes. This chapter covers FEEL’s wealth of rounding functions and how to handle invalid items in functions that combine lists of numbers. The Author also discusses how to access additional math functions by calling the free api.mathjs.org service from a BKM, how to interpolate values from published data tables, and numerical methods including Taylor Series and the Newton-Raphson method.

Chapter 19: Machine Learning Recipes. The Author explores various ways DMN can be applied in machine learning, including dataset correlation and linear regression. In addition to presenting an analytical solution to linear regression, the chapter illustrates how recursion in DMN can be used to perform linear regression using gradient descent—a technique widely used in machine learning algorithms. The chapter also shows how a BKM can directly execute any machine learning model packaged using the PMML standard.

Chapter 20: Data Validation Recipes. This final chapter provides a detailed walkthrough of one of the four methods described in Chapter 12, offering an in-depth example that is too complex to discuss in the earlier chapter.