Blog Post

Azure Integration Services Blog
3 MIN READ

Announcing the Public Preview of the Azure Logic Apps Rules Engine!

hcamposu's avatar
hcamposu
Icon for Microsoft rankMicrosoft
Jun 10, 2024

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. I have uploaded the SchemaUser.xsd file used for this sample.

 

 

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

 

 

 

 

Feedback?

 

If you have any feedback after testing this feature, please use this link: Rules Engine Feedback.

 

Updated Nov 13, 2024
Version 4.0
  • SumitGaur680's avatar
    SumitGaur680
    Copper Contributor

    hcamposu  are the business rules are going to be only associated with the linked logic app only which we create in vs code or these rules can be accessible by multiple logic app standard like we had in the BizTalk BREs?

  • Hi SumitGaur680 . For this public preview the Rules Engine, the RuleSets are available at the Logic App level. We are exploring customer scenarios to expand this across other logic apps.

  • willis70's avatar
    willis70
    Copper Contributor

    Hi hcamposu what level of features will be available via the Logic App designer in the future? When will this be released? 

  • kc_analytics's avatar
    kc_analytics
    Copper Contributor

    Hi hcamposu , Does this logic apps integrate with Azure Data factory or Microsoft Fabric data factory? I have a requirement where I need to maintain the business rules in a rules engine and then based on the rules I need the data to be transformed. Ex: Business rule : If Column A  in a dataset contains %image% then column B should be updated to 'image created'.  Is this something that can be achieved using logic apps(integrate logic apps with ADF or Microsoft fabric Data Factory?

  • Hi kc_analytics . Azure Logic Apps integrates with Azure Data Factory and Azure Data Lake. Your requirement can be fulfilled with an Azure Logic Apps workflow by designing a simple workflow that reads your data, and make the status change.

     

    Today, you can use the Logic Apps Rules Engine only if your data source is expressed as XML or a .NET assembly fact. It is ideal for customers using BizTalk Server.