StateMachine Scenario Using a Combination of FlowChart and Pick
This topic applies to Windows Workflow Foundation 4 (WF4).
This sample demonstrates how to implement a simple stopwatch scenario using a combination of the Flowchart and Pick activities. It uses Receive and Send within the Pick activity to listen for stopwatch events.
Sample Details
The following table lists the projects in this sample.
Project Name |
Description |
StopWatchService |
This project contains the implementation of a state machine for the stopwatch sample using a combination of the Flowchart and Pick activities. The Pick activity has 3 PickBranch statements within the Branches property that listen for The FlowDecision activity at the end of the Flowchart evaluates the |
StopWatchClient |
This is a simple sequential workflow console application that sends various stopwatch events with simple Send or Receive activity combinations. |
To use this sample
Using Visual Studio 2010, open StateMachineWithPick.sln solution file.
To build the solution, press CTRL+SHIFT+B.
Start the StopWatchService.exe from Windows Explorer as an administrator by right clicking the .exe file and selecting Run as administrator.
Navigate to the StateMachineWithPick\CS\StopWatchService\bin\Debug folder.
Right-click the StopWatchService.exe file and select Run as administrator.
Start the StopWatchClient client application from within Visual Studio 2010.
In Solution Explorer, select the StopWatchClient project and right-click Set as StartUp Project.
To run the solution, press CTRL+F5.
Switch back to the console window for the StopWatchService.exe to view the state transitions.
Note: |
---|
The samples may already be installed on your computer. Check for the following (default) directory before continuing.
<InstallDrive>:\WF_WCF_Samples
If this directory does not exist, go to Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) Samples for .NET Framework 4 to download all Windows Communication Foundation (WCF) and WF samples. This sample is located in the following directory.
<InstallDrive>:\WF_WCF_Samples\WF\Scenario\StateMachineWithPick
|