Sample to understand basic local communications in Workflow

by Matt Milner 2. April 2006 19:31
I've been teaching a lot of folks workflow as part of the Longhorn Server Ascend training and the simple example that I was using just didn't cut it.  So, I put together a set of example applications to show how the basic local communications work.  The main thing I wanted to show was how the use of an interface as the contract between your workflow and your host, allows you to swap out different hosts and provide different implementations of the local service, without the workflow having to know or care about any of this.  The workflow simply looks for a service that implements the right interface, and then calls into that class based on the interface. 
 
So, I created three different implementations of a VERY basic coffee machine: console, WinForm and ASP.NET.  The sample shows how you can simply add the right type of service implementation for your host and the workflow can be used in a number of environments.  The code is pretty well commented so you should be able to follow along. 
 
This works on WF 2.0 (Feb CTP).  Everything except the ASP.NET application will work on the 2.2 release as well.  I'll provide an update here when I get the ASP.NET example ported over to 2.2 later this week. 
 
Any feedback or questions are welcome.  Enjoy. 
 
The 2.0 compatible code is here.
I've uploaded the 2.2 compatible code here.
 

Tags:

Windows Workflow Foundation