Implementing Mission Critical Solutions with the Azure Logic Apps Rules Engine
Business rules engines offer a low-code environment that lets you build applications faster and easier, reducing dependencies on programming. Rules engine help to create and change business logic without having to write code or restart the applications that use them. Also, In a world of microservices that promotes decoupling, rules engines provide consistency, clarity, and compliance across different services and domains. Those are some of the benefits of using a Rules Engine.
BizTalk Server includes a Business Rules Engine. We have incorporated the RETE runtime included in the product along with support of .net and XML facts into Azure Logic Apps. This means that customers migrating from BizTalk Server can leverage their existing BRE implementations in Azure Logic Apps now. This includes our customers looking to migrate their BizTalk Server SWIFT solutions to Azure Logic Apps.
The Microsoft Rules Composer
To help you create rules for use with your Azure Logic Apps Rules Engine project, the Microsoft Rules Composer provides a visual tool for authoring and versioning rulesets and vocabularies. It is an stand along application that can be downloaded from https://www.microsoft.com/en-us/download/details.aspx?id=106092.
Rules
Rules are declarative statements that include a condition and actions where the condition is evaluated. If the result is true, the rules engine performs one or more actions. The following diagram shows the relationship between Rulesets, Rules, Facts, Conditions and Actions:
What are Vocabularies?
Vocabularies are collections of definitions consisting of friendly names for the facts used in rule conditions and actions. They make the rules easier to read, understand, and share by people in a particular business domain. For instance: “Status”. Vocabularies can be of the following types:
Constant Value
Range of Values
Set of Values
Control functions and Forward Chaining
Control functions help applications to control the facts in the engine’s behavior. Facts in working memory drive the conditions that the engine evaluates and the actions that execute. An example of this is the Forward Chaining Inference. The Forward Chaining Inference finds all true statements given the knowledge base and a new set of facts. It uses the control function “Update”.
Testing Rules
The Microsoft Rules Composer follows a Shift left approach: As you build your rulesets so that you can integrate business logic with your Standard workflows, you can test your ruleset incrementally. This feature is recommended for long or complex rules, to avoid lengthy troubleshooting.
To test .net facts, you should build a Fact creator. You don’t need Fact creators for XML facts.
The outcome is a trace window with the results of the evaluation of the rules.
Migrating from BizTalk Server
As the Logic Apps Rules Engine, is an evolution of the BizTalk Business Rules Engine (BRE), BRE rules can be used in Logic Apps. As policies no longer exist, you should export each policy individually.
As DBFacts are not supported in this release, you need to remove them from your policies or refactor them.
Creating Rules in VSCode
You can create Rules Engine projects using VSCode. You should create a Logic Apps workspace and then a Logic app with rules engine project.
For a complete demonstration on how to use the Azure Logic Apps Rules Engine, watch the following video:
Microsoft Tech Community – Latest Blogs –Read More