WF Rules Engine Without Workflows?

I never really gave much attention to working just with the rules engine that comes with WF. Usually I am building processes from scratch, and by doing so leveraging the rules engine through the Policy Activity while building workflows. Recently though, I accepted a new job and I am being tasked with handling additional functionality to current processes, that using workflows for would be overboard but not impossible Undecided. But this got me thinking though and I remembered hearing about using the rules engine without workflows. Basically I was getting hit up for tasks that made the idea even more inviting to try, but honestly if I had not had the honor of working with WF, I might have passed up the thought of using the rules engine independently from WF all together. Although I plan to put together a tutorial on how to accomplish this in some logical manner later, at this point my post is intended to explain the thought process of why you would do this, and what actually takes place under the hood.

Conditions for using WF's Rule Engine Independently 

1.     Processes already exists

2.     Rules can change over short durations

3.     During processing, rulesets can be driven execute by non technical staff

How does it happen?

1.     While creating rules in workflows using Policy activities, rules are created using a ruleset editor. Many rules make up a ruleset and a ruleset is executed at designated times. There is a great example here.

2.     Rulesets are stored as XAML within a .rules file. This is important because the rules can be modified by making changes to the XAML, and they can also be stored in SQL Server as a central location for reuse through serialization to other applications.

3.     Rules are made up of exposed properties, methods, etc. that reside within an assembly.

4.     Rules are deserialized into RuleSet objects that are validated by the rules engine so they can be executed

5.     Finally the rules can be executed when ever processing needs to occur.

Finally, independently using the rules engine that comes with WF can really change the way applications are written today. Of course there are other rules engines out there, however WF's does a majority of what you will probably need. By placing rules outside of applications, they can flexibility of how they process, while promoting code reuse within others. Make sure you take the time to check out WF's Rules Engine. My team is already pumped with the idea of learning how to separating them out and I think you will be too.


Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 9/18/2008 at 3:49 PM
Actions: E-mail | Kick it! | DZone it! |
Post Information: Permalink | Comments (127) | Post RSSRSS comment feed


Comments are closed