Completed Rules and Conditions Tutorial 

Download sample

NoteNote

The project files that are listed here contain the complete source code for Tutorial: Use Rules and Conditions.

This tutorial demonstrated various aspects of using rules and conditions in Windows Workflow Foundation.

Tutorial Overview

In Exercise 2: Use Rules and Conditions with the IfElseActivity, an IfElseActivity activity is added to a sequential workflow. This activity has the option of using a CodeCondition or a RuleConditionReference for its conditional evaluation. In Task 2: Use the IfElseActivity with a CodeCondition, a CodeCondition is created and used. In the following task, Task 3: Use the IfElseActivity with a RuleConditionExpression, another IfElseActivity activity is created, but instead of a CodeCondition, rules are used by associating a RuleConditionReference with the IfElseActivity activity.

Exercise 3: Use Rules and Conditions with the ConditionedActivityGroup demonstrates a more advanced use of rules with the ConditionedActivityGroup activity and a PolicyActivity activity. Task 2: Create the PolicyActivity and RuleSet uses a RuleSet to group related rules together based on the policy that is being implemented. In this tutorial, the RuleSet contains the rules that implement the discount policy for a shopping cart application.

See Also

Concepts

Rules and Conditions Overview

Other Resources

Rules and Conditions

Footer image

Send comments about this topic to Microsoft.