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 476 views


            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

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