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.

posted on Thursday, August 31, 2006 10:49 PM by scott

Comments

Saturday, September 02, 2006 8:55 PM by Christopher Steen

# Link Listing - September 2, 2006

Mono 1.1.7 and NUnit [Via: Jamie Cansdale ] Build it quickly, use it as soon as possible, and make it...
Friday, September 29, 2006 5:55 PM by csaxton

# re: New Article on Windows Workflow Rules and Conditions

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
Sunday, October 01, 2006 9:21 PM by scott

# re: New Article on Windows Workflow Rules and Conditions

Thursday, October 05, 2006 8:02 PM by DJL

# re: New Article on Windows Workflow Rules and Conditions

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?
Saturday, October 07, 2006 12:11 PM by scott

# re: New Article on Windows Workflow Rules and Conditions

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.
Thursday, November 30, 2006 4:08 PM by Rory Primrose

# re: New Article on Windows Workflow Rules and Conditions

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
Thursday, January 11, 2007 7:56 PM by RulesReader

# re: New Article on Windows Workflow Rules and Conditions

Excellent article. Very thorough and complete! Impressive work.