Partilhar via


Changing Rules Sample

Download 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.

Note

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:

Changing Rules Sample Output

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 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.

See Also

Reference

RuleDefinitions
RuleConditionCollection
RuleExpressionCondition
ApplyWorkflowChanges
WorkflowChanges

Other Resources

Using Dynamic Updates in Workflows
Applying Dynamic Updates to Workflows
Dynamic Update Samples
Dynamic Update from Host Sample
Dynamic Updates to Rule Conditions

© 2007 Microsoft Corporation. All rights reserved.