Changing Rules Sample
The workflow in this sample implements a simple PO approval condition: if the supplied PO amount is less than or equal to $10,000, the PO requires manager approval; otherwise, it requires VP approval. The workflow runs this logic two times via a simple WhileActivity loop. The application starts the workflow with a request value of $14,000. Therefore, for the first iteration of the loop, VP approval is required.
For the second iteration of the loop, the business logic is changed, and the manager approval threshold is increased to $15,000. Therefore, on the second execution, only manager approval is required.
For the sake of simplicity, this sample uses a DelayActivity activity to block the workflow. For a more robust application, a SuspendActivity activity or a HandleExternalEventActivity activity should be used.
When you build and run the sample, your output will appear similar to the following:
To build the sample
Download the sample by clicking Download Sample.
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 DynamicUpdateChangingRules\bin\debug folder (or the DynamicUpdateChangingRules\bin folder for the Visual Basic version of the sample), which is located below the main folder for the sample.
© 2007 Microsoft Corporation. All rights reserved.