New Article on Windows Workflow Rules and Conditions

If you only look at one feature in Windows Workflow, look at the Policy activity. The Policy activity processes rules. Business rules, game rules - any type of declarative knowledge. Read more in the latest OdeToCode article - "Windows Workflow - Rules and Conditions".

The Policy activity is easy to use, and provides a boatload of functionality out of the box. You can prioritize rules, and track rule processing in detail. WF provides an API to modify rules at runtime, which provides a great deal of flexibility. Rules execute with forward chaining semantics, meaning the rules engine analyzes the dependencies and side effects of each rule, and can reevaluate rules when the underlying data changes. I can see applications using Windows Workflow solely for the Policy activity.

More Workflow articles on OTC:
Hello, Workflow - an introduction.
Authoring Workflows - a look at XAML, XOML, and Workflow compilation.
The Base Activity Library - a tour of the out-of-the-box activities in WF.
Hosting Windows Workflow - a look at using the persistence, scheduling, tracking, and transaction services in WF.

Print | posted @ Friday, September 01, 2006 2:49 AM

Comments on this entry:

Gravatar # re: New Article on Windows Workflow Rules and Conditions
by csaxton at 9/30/2006 12:55 AM

Great article on the WWF Rules engine. I am curious how one would implement a rule that is applied to a collection of items, something akin to "IF request.Payments[n].Amount > 10000 THEN request.Payments[n].RequiresApproval = true"

Cheer,
C
  
Gravatar # re: New Article on Windows Workflow Rules and Conditions
by scott at 10/2/2006 4:21 AM

csaxton: See odetocode.com/.../7293.aspx
  
Gravatar # re: New Article on Windows Workflow Rules and Conditions
by DJL at 10/6/2006 3:02 AM

Great article...thanks.
I have created a xoml file containing several custon activities, in addition to an IfElse activity. In the ifelse, I wish to write a rule that involves the value of one of the other activities in the workflow. Because this is a xoml based workflow, there are no class attributes in the file, so I am prevented from writing a conditional rule such as...
ActivityA.AccountBalance == 1000.
Upon closing the rules editor, I am told that the rule is invalid. How do I get around this for xoml-based workflows?
  
Gravatar # re: New Article on Windows Workflow Rules and Conditions
by scott at 10/7/2006 7:11 PM

DJL: It sounds like activity binding is the solution for you, though I would have to see the code to be sure.

Create a dependency property on your custom activity that binds to the value in the other activity (Activity=ActivityA, Path=AccountBalance). Then your condition can use the local property on your activity.
  
Gravatar # re: New Article on Windows Workflow Rules and Conditions
by Rory Primrose at 12/1/2006 12:08 AM

Thanks for the article. Is it possible that one rule in a ruleset can enable or disable another rule in the set?

I have a set of rules that need to check an object chain for null references. If the chain goes object.object.Nullable<int>, I need to check that both objects exist and that the int != null before running a rule against the int value. If any of the rules fail, the other rules need to be disabled to avoid a null reference exception.

I guess I could add more conditions to each rule to check the values of each point in the chain, but that seems heavy handed.

Cheers
  
Gravatar # re: New Article on Windows Workflow Rules and Conditions
by RulesReader at 1/12/2007 3:56 AM

Excellent article. Very thorough and complete! Impressive work.
  

Your comment:

Title:
Name:
Email:
Website:
 
Italic Underline Blockquote Hyperlink
 
 
Please add 4 and 1 and type the answer here: