State Machine Communication Sample
This sample demonstrates how to use events that are sent from the host application to set the state in a state machine workflow.
In the sample, a simple local service called EventService is used to send an event to the workflow called SetState. When the workflow starts, it immediately idles and listens for the SetState event by using a HandleExternalEventActivity activity. When the event is raised by the host, the workflow resumes execution, sets the state to the workflow's completed state, and exits.
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 StateMachineCommunication\bin\debug folder (or the StateMachineCommunication\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.