Windows Workflow Foundation (WF) includes a flexible Rule Engine, allowing the Workflow developer to logically separate your application's business rules from the Workflow Assemblies. Rules allow you to model and implement the business requirements of your application into a set of declarative statements, which can be enforced at runtime.
A WF Rule is composed out of the following three separate parts:
1.A Condition which evaluates to a Boolean result.
2.A Then Action which is executed if the condition evaluates to true.
3.An optional Else Action which is executed if the condition evaluates to false.
The WF Visual Studio designers include a set of Rule Editor Dialogs. These editors allows the developer to create individual rules, and combine them together into a RuleSet. Alternatively, you can use any .NET language to create the a RuleSet through custom code.
Traditionally, WF Rules are used in the following two context:
1.Within a Declarative Rule Condition. Such a rule condition can be part of an IfElseBranchActivity, a WhileActivity, or any other activity which needs to evaluate a simple or compound boolean expression.
2.Within a Policy activity. A Policy activity evaluates a RuleSet, and applies the Then or Else actions of each Rule in the RuleSet, based upon the Rule's condition. The Rule Engine has the ability to apply forward chaining, which is a mechanism in which dependencies within rules are automatically detected, and Rules can be re-evaluated as a result of these dependencies.
Alternative Applications for the WF Rule Engin
No comments:
Post a Comment