Tutorial: Use Rules and Conditions 

Rules and conditions are used by several activities that need a mechanism to execute logical statements to determine a path of execution in the workflow. Additionally, rules also have the ability to apply additional application logic during the processing of the workflow. In this tutorial, you will learn how to use rules and conditions in your workflow.

The application that you build in this tutorial is a point-of-sale simulator. A user can add available items into a shopping cart and then apply any number of coupons. When this is finished, and the Checkout button is clicked, a sequential workflow is activated to determine the discount price that the user receives from the selected coupons. When this discount is determined, the discount price and the final total price are returned to the application, and the result is displayed.

To achieve this, you will create a Windows Form host application. The workflow in this application is a sequential workflow that contains activities that use rules and conditions. Specifically, you will learn how to use conditions and rules in an IfElseActivity activity, a ConditionedActivityGroup activity and a PolicyActivity activity.

In This Section

Exercise 1: Create the Rules and Conditions Project

Exercise 2: Use Rules and Conditions with the IfElseActivity

Exercise 3: Use Rules and Conditions with the ConditionedActivityGroup

Completed Rules and Conditions Tutorial

Reference

IfElseActivity

ConditionedActivityGroup

PolicyActivity

Workflow Changes to Rule Conditions

Using Conditions in Workflows

How to: Use Conditions Through Code

Rules Evaluation in RuleSets

Rules and Conditions

Using the PolicyActivity Activity

Footer image

Send comments about this topic to Microsoft.