36.2. Windows Workflow Foundation

Over time, organizations try to keep improving their internal processes for menial tasks such as expense reporting and timesheeting. This results in their defining a series of steps, or activities, that make up a process, or workflow. The Windows Workflow Foundation (WF) builds on this concept to allow the rapid development of such workflows. Although it has been built as an engine on which developers can build their own applications, there are already commercial products, such as Sharepoint, that make use of this engine to allow non-developers to build business workflows.

Again, we will not go into much detail about WF itself, instead providing a walkthrough of how you can get started with building a workflow application using Visual Studio 2008 and linking it with the WCF service you have just created. In this example, we will start by adding a new project based on the Sequential Workflow Console Application. As you can see in Figure 36-9, you have a number of different WF project types to choose from depending on whether you want a sequential or a state machine workflow, and whether you want a console application or workflow library. In this case we want a sequential workflow because we want a workflow that has a start, goes through a series of activities, and then ends, and we want a console application so that we don't have to worry about hosting the workflow. The console application template contains the necessary code to host the workflow, ...

Get Professional Visual Studio® 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.