Workflow with Parameters 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
Download the sample by clicking Download Sample in this topic.
This extracts the sample project to your local hard disk.
Click Start, point to Programs, point to Microsoft Windows SDK, and then click CMD Shell.
Go to the source directory of the sample.
At the command prompt, type MSBUILD <Solution file name>.
To run the sample
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:
© 2007 Microsoft Corporation. All rights reserved.