+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 1825 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

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