This documentation is archived and is not being maintained.

RuleSet Class

Contains a collection of Rule classes along with the semantics for forward-chaining execution of those rules. A RuleSet can be executed directly in code or via the PolicyActivity activity.

Namespace: System.Workflow.Activities.Rules
Assembly: System.Workflow.Activities (in system.workflow.activities.dll)

public class RuleSet
/** @attribute SerializableAttribute() */ 
public class RuleSet
public class RuleSet
Not applicable.

The following example shows how to programmatically create a RuleSet. In this example, a RuleSet object is first created before rules are added to it. Following this, reference expressions are created in order to connect the rules with instance data present in the class that implements the BuildRuleSet method. The discount, orderValue and customerType references are fields defined within the class. The next step is to create the residential discount rule using objects from the System.CodeDom namespace. The rule that is being created, checks if the order value is greater than 500 and if the customer type is residential. If the condition is true, the discount that is applied is 5%. Next, a similar rule is created using different values to indicate a discount that is applied if the customer is a business customer type. Both of these rules are added to the initial RuleSet.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0