This presentation was given as an interactive session at TechEd 2009 in LA. In this session I covered how to communicate with state machine workflows that were listening for events through the ExternalDataExchange. The workflow is a simple approval workflow that demonstrates multiple states listening for the same event and one state listening for two events.
The three important classes are the MSMQMessageBroker, FileSystemBroker, and DatabaseBroker. These message brokers translate the system events into events that can be consumed by states in the workflow.
The event collector is a class that can host multiple "brokers" by loading it as the ExternalDataExchange instead of the specific message brokers. To do this, the base class of the specific message brokers must be changed to the NotifierBase.
The WCF project is an example of how to reuse the broker base and communicate with a state machine workflow hosted in WCF which is ultimately an IIS process.
I hope to write a paper on this to explain it better.
Teched 09 State Machine Demo.zip