In one of my last project, I have been working extensively with the Business Rules Engine in BizTalk. This project contains some complex Federal/State/Company/ rules. Being a Health Management Care related project I have to deal with many issues like requirements, changing policies, rules scope to a certain type, etc.
Delivering this project took some time and effort. Not only the requirements were *agile*, but trying to keep compliance with SOX laws was a challenge. I can summarized all of the requirements to these 3:
Requirements:
- Policies have to be atomic (independent from changes to other policies)
- Versionning of policies and being able to execute ANY version, any time.
- Need to know which facts were used to determine an outcome.
For the main requirement, I have created a Master Rule that determine the outcome, then I've created several *supporting* rules that will help me determine which of the rules were evaluated. The versionning requirement was already implemented by the BRE in BizTalk.
a sample of this would be something like this:
It quickly became very obvious that I have to deal with lots of policies and vocabularies. If you ever tried using the Rules Deployment Wizard, you will see that it only allows you to export a SINGLE policy at a time. Having over 500+ policies and over 30+ vocabularies was not going to work out.
I have found the DeployRules.exe application written by Sreedhar Pelluru from Microsoft. Here is the original article. I took his program and modified to meet my needs. Since I was only testing a set of policies at a time (i.e. Federal policies only), this tool provide me the ability to only load those policies that were relevant to the type I was working on.
I know I have learned a lot about the BRE api from reading his well documented code. With his permission, I have posted his original work and the modifications done to it back to the community at http://www.codeplex.com/DeployRules. Yes it is still a work in progress.
Hope this help someone out there.