Partilhar via


Simple Sequential Workflow Sample

Download sample

This sample uses the Windows Workflow Foundation component model to construct a simple purchase order (PO) approval workflow with a single IfElseActivity activity and two IfElseBranchActivity activities. Each branch contains a CodeActivity activity that writes to the console whether the order was approved or rejected. The IfElseActivity activity uses a code condition to evaluate which branch to take. In this sample, the condition always returns true. Therefore, the first branch is always taken and the program reports that all orders are approved.

To build the sample

  1. Download the sample by clicking Download Sample.

    This extracts the sample project to your local hard disk.

  2. Click Start, point to Programs, point to Microsoft Windows SDK, and then click CMD Shell.

  3. Go to the source directory of the sample.

  4. At the command prompt, type MSBUILD <Solution file name>.

To run the sample

  1. In the SDK Command Prompt window, run the .exe file in the SimpleSequentialWorkflow\bin\debug folder (or the SimpleSequentialWorkflow\bin folder for the Visual Basic version of the sample), which is located below the main folder for the sample.

See Also

Reference

SequentialWorkflowActivity
IfElseBranchActivity
IfElseActivity

Other Resources

Creating a Sequential Workflow
Sequential Workflows
Workflow with Parameters Sample
Tutorial: Create a Sequential Workflow
Using the IfElseActivity Activity
Using the IfElseBranchActivity Activity
Basic Workflows Samples
Windows Workflow Foundation Samples

© 2007 Microsoft Corporation. All rights reserved.