Learn about dynamic decision management systems
In Chapter 14, we explained the integration and use of Activiti and the rule engine. To be precise, the integration of Activiti and the Drools rule engine. After the release of Activiti6 version, Activiti began to implement the DMN specification. In other words, Activiti is implementing its own rules engine. Although it has not yet been completed, it has taken a prototype. This chapter will describe the DMN specification and the preliminary implementation of the Activit rule engine.
When the author wrote the book, Activiti’s rule engine had not been officially released, and no relevant information was found in official documents and APIs. The content of this chapter was written by the author with reference to the source code of the Activiti rule engine module. In future Activiti versions, The implementation and published documents of the rule engine may conflict with the content described in this book. Readers are encouraged to understand this situation.
The emergence background of DMNDMN is the abbreviation of English Decision Model and Notation, and its literal translation means decision model and graphics. According to the previous chapter, BPMN is a workflow specification released by OMG, and DMN is also a specification released by OMG. This specification is mainly used to define models and graphics for business decision-making. Version 1.0 was released in 2015, and the latest version is 1.1. , released in 2016.
BPMN is mainly used to standardize business processes. The logic of business decisions is defined by specifications such as PMML. For example, in some business processes, multiple decisions are needed to determine the direction of the process, and each decision must be based on its own rules. To decide, and there may be correlation between each decision, there is a gap between BPMN and PMML. Before the emergence of DMN specification, decision-makers could not participate in the business. In order to fill the gaps in the model, the DMN specification is added to define the specifications and graphics for decision-making. The DMN specification is equivalent to the bridge between the business process model and the decision-making logic model.
Although DMN only serves as a bridge between workflow and decision-making logic, in fact, the specification also contains the decision-making logic part, and is also compatible with the expression language defined by the PMML specification. In other words, the framework that implements the DMN specification will also have the ability to process business rules.
Activiti and DroolsAs a workflow engine, Activiti is not comparable to the rule engine Drools. They are more complementary. However, Activiti is currently implementing the DMN specification, and Drools implements the PMML specification. This means that Activiti's After the work engine is completed, it also includes the function of the rule engine. According to the DMN specification, the implementer of the DMN specification will also provide support for PMML. As a result, Activiti's rules engine and Drools will compete.
JBoss has the workflow engine jBPM and the rule engine Drools. Activiti itself is a workflow engine. Coupled with the rule engine added in this update, it is estimated that in the near future, Activiti will be in the field of workflow engine and rule engine. , can compete with JBoss.
DMN’s XML sampleDMN mainly defines the decision-making model. Similar to the BPMN specification, the DMN specification released by OMG contains corresponding XML constraints. The current version of Activiti implements the decision part, so this chapter only describes the decision part in DMN. For DMN XML documents, the file name suffix is generally dmn. Code Listing 15-1 is a simple DMN document.
Code Listing 15-1: codes\15\15.1\sample.dmn
The XML document in Code Listing 15-1 defines a decision node, which contains an input parameter, an output result and two rules. Note that the bold code in the code listing uses the startsWith method, which defines that if the parameter string starts with "Angus", the first rule will be triggered, and if the parameter character starts with "Paris", the second rule will be triggered. The description of each element in the XML document will be described in subsequent chapters.
The article is reprinted from Open Source China Community [http://www.oschina.net]The above is the detailed content of Learn about dynamic decision management systems. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

VS Code system requirements: Operating system: Windows 10 and above, macOS 10.12 and above, Linux distribution processor: minimum 1.6 GHz, recommended 2.0 GHz and above memory: minimum 512 MB, recommended 4 GB and above storage space: minimum 250 MB, recommended 1 GB and above other requirements: stable network connection, Xorg/Wayland (Linux)

The reasons for the installation of VS Code extensions may be: network instability, insufficient permissions, system compatibility issues, VS Code version is too old, antivirus software or firewall interference. By checking network connections, permissions, log files, updating VS Code, disabling security software, and restarting VS Code or computers, you can gradually troubleshoot and resolve issues.

Although Notepad cannot run Java code directly, it can be achieved by using other tools: using the command line compiler (javac) to generate a bytecode file (filename.class). Use the Java interpreter (java) to interpret bytecode, execute the code, and output the result.

VS Code is the full name Visual Studio Code, which is a free and open source cross-platform code editor and development environment developed by Microsoft. It supports a wide range of programming languages and provides syntax highlighting, code automatic completion, code snippets and smart prompts to improve development efficiency. Through a rich extension ecosystem, users can add extensions to specific needs and languages, such as debuggers, code formatting tools, and Git integrations. VS Code also includes an intuitive debugger that helps quickly find and resolve bugs in your code.

VS Code is available on Mac. It has powerful extensions, Git integration, terminal and debugger, and also offers a wealth of setup options. However, for particularly large projects or highly professional development, VS Code may have performance or functional limitations.

Visual Studio Code (VSCode) is a cross-platform, open source and free code editor developed by Microsoft. It is known for its lightweight, scalability and support for a wide range of programming languages. To install VSCode, please visit the official website to download and run the installer. When using VSCode, you can create new projects, edit code, debug code, navigate projects, expand VSCode, and manage settings. VSCode is available for Windows, macOS, and Linux, supports multiple programming languages and provides various extensions through Marketplace. Its advantages include lightweight, scalability, extensive language support, rich features and version

The main uses of Linux include: 1. Server operating system, 2. Embedded system, 3. Desktop operating system, 4. Development and testing environment. Linux excels in these areas, providing stability, security and efficient development tools.

To view the Git repository address, perform the following steps: 1. Open the command line and navigate to the repository directory; 2. Run the "git remote -v" command; 3. View the repository name in the output and its corresponding address.
