Jump to content

Implementing Mission Critical Solutions with the Azure Logic Apps Rules Engine


Recommended Posts

Guest hcamposu
Posted

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.

 

 

 

largevv2px999.png.e61520e807a4f3d2538d6760ffd88450.png

 

 

 

 

 

[HEADING=1]The Microsoft Rules Composer[/HEADING]

 

 

 

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 Download Microsoft Rules Composer from Official Microsoft Download Center.

 

 

 

largevv2px999.png.5fbba12f6291023c1508d1a81a6e9f84.png

 

 

 

 

 

[HEADING=1]Rules[/HEADING]

 

 

 

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:

 

 

 

largevv2px999.png.f5255057800c19016dc9f4021143ac89.png

 

 

 

 

 

[HEADING=1]What are Vocabularies?[/HEADING]

 

 

 

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

 

 

 

largevv2px999.png.ae2b3366397450f7ca404c5ad1b376f6.png

 

 

 

[HEADING=1]Control functions and Forward Chaining[/HEADING]

 

 

 

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”.

 

largevv2px999.png.1cb467bcefd2a2e102538ee4728b0c69.png

 

 

 

[HEADING=1]Testing Rules[/HEADING]

 

 

 

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.

 

 

 

mediumvv2px400.png.85c965b963e9b43e895f09b3170607fb.png

 

 

 

To test .net facts, you should build a Fact creator. You don’t need Fact creators for XML facts.

 

largevv2px999.png.33888ad30de1c0f503ca72fc04d8bd5f.png

 

 

 

The outcome is a trace window with the results of the evaluation of the rules.

 

 

 

largevv2px999.png.5988ba311f6e8ca10a7b815ead7d0365.png

 

 

 

 

 

[HEADING=1]Migrating from BizTalk Server[/HEADING]

 

 

 

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.

 

 

 

mediumvv2px400.png.ffae4c23b3b9530d88ee620de5d06930.png

 

 

 

As DBFacts are not supported in this release, you need to remove them from your policies or refactor them.

 

 

 

[HEADING=1]Creating Rules in VSCode[/HEADING]

 

 

 

You can create Rules Engine projects using VSCode. You should create a Logic Apps workspace and then a Logic app with rules engine project.

 

 

 

largevv2px999.png.3a870e400adbbb9f94bef611804baf12.png

 

 

 

For a complete demonstration on how to use the Azure Logic Apps Rules Engine, watch the following video:

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...