+91-9464001760
29-404, LPU, Jal-Del G.T. Road - Phagwara, PB, India
09:30 am – 05:30 pm

Business Rule Engine (BRE) in C#

Published On: Monday, June 17, 2019 123 views

Hello,

            I’ve been doing quite some research for an apt technical solution (in C#) for implementing automated business rules on large datasets, whether stored locally or in the cloud, which allows dynamic loading of rules, facts, and target datasets. So I came across various implementations, concepts, ideas, and models boasting this functionality with certain pros and cons of each implementation; however I couldn’t find anything simple enough until I decided to build one myself.

 First task was to understand the architectural requirements for such a solution and then proceed towards building the structural dynamism using code. For such a system to be built, I resorted towards creating a foundational database structure which allows CRUD operations for creating / storing business rules, then moving towards loading rules in-memory and on-demand within the context of supplied datasets; and ultimately executing those rules on the supplied dataset for results. Results produced predictively enough had a requirement to further notify or take an action if a rule was passed or failed during execution. Here one important concept to implement at this stage was to ensure the principle of recursion commonly used in coding. Recursion principle ensures firing of rule engine again when a condition is matched regardless of the program flow. This ends up creating a very dynamic rules execution plan / engine / workflow which works quite magically ‘as-and-when or if’ the data becomes available for an in-memory object. I see some application of this in real-time systems such as IoT devices or services. Using C# language’s latest features allowed me to have above code implementation as neat and readable as possible for any future modifications.

 

Truly interesting stuff!


Post by: Sarabpreet Singh
Contact author: click here

Key Words

idea across when understand concept until dataset myself various target technical principle recursion such code rule fact decide proceed implement business cloud dynamic build however requirement which simple create load locally solution memory supply automate model enough find couldn engine boast quite First implementation whether Hello execution result task system towards research functionality ensure large architectural store