Dynamic Update from Host Sample
This sample demonstrates how to dynamically update a workflow instance from outside the workflow, that is, from the host program.
The workflow is designed to receive a purchase order request of some amount. This workflow has a CreditCheck DelayActivity activity followed by a POCreated CodeActivity activity. However, because of unusual circumstances, all purchase order requests must be denied. The host performs a dynamic update to remove the purchase order creation step to deny all purchase order requests. This dynamic change is performed outside the workflow from the host.
A more realistic scenario of an unanticipated event that requires denial of all purchase order requests is for the host to issue a Suspend request for all running instances, and then perform a dynamic update to the instances.
In this sample, the unanticipated scenario is contrived by the presence of a CreditCheck DelayActivity activity that gives the host the opportunity to handle the WorkflowIdled event somewhere in the workflow instance.
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 DynamicUpdateFromHost\bin\debug folder (or the DynamicUpdateFromHost\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.