Share via


Workflow with Parameters Sample

Download sample

This sample illustrates how to build a simple sequential workflow by using parameters. The sample is based on the Simple Sequential Workflow Sample. Two additional features are that the Amount workflow parameter is evaluated by the code condition in the IfElseActivity activity, and the order status is stored in the Status workflow parameter.

The sample uses the Windows Workflow Foundation component model to construct a simple purchase order (PO) approval workflow with a single IfElseActivity activity that has two branches. The host application takes a single parameter that is passed into the workflow as the order amount. If the order amount is less than 500, the order is approved; otherwise, it is rejected. To pass the order status back to the host, the parameter status is set to Approved or Rejected in the CodeActivity activities in the IfElseBranchActivity activities.

To build the sample

  1. Download the sample by clicking Download Sample in this topic.

    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 WorkflowWithParameters\bin\debug folder (or the WorkflowWithParameters \bin folder for the Visual Basic version of the sample), which is located below the main folder for the sample. Execute the program with an integer value that specifies the amount of the purchase order:

    WorkflowWithParameters.exe 200
    

See Also

Reference

SequentialWorkflowActivity

Other Resources

Creating a Sequential Workflow
Sequential Workflows
Simple Sequential Workflow Sample
Basic Workflows Samples
Windows Workflow Foundation Samples

© 2007 Microsoft Corporation. All rights reserved.