Meet The Parallel Activity
I've been learning a lot about Windows Workflow lately and the main way which I learn is by writing code. So I've written a sample today that deals with the ParallelActivity and is largely based on the much simpler version from chapter 11 Kenn Scribner's excellent book Microsoft Windows Workflow Foundation Step by Step.
Most sample applications are Console apps which are fine to illustrate a simple thing, however they often don't capture many of the difficult challenges of using a workflow from other environments like a Form application. They also don't show how to unit test things.
So I've create a more substantial Windows Form app that invokes the workflow and receives notifications from it as phrases are uttered from the workflow.
While this looks like an amazingly simple application, there are significant challenges to overcome.
- How to communicate between the workflow and the host
- How to safely update UI controls when called back on the workflow thread
- How to unit test the workflow
Yes - I did build a unit test that tests this workflow (and I built it first in the TDD style).
I hope you enjoy it and learn something from it - I know I certainly learned a lot by building this.
You can find this ParallelActivity and other samples at www.ronjacobs.com (look at the Samples folder).
Comments
Anonymous
February 21, 2008
PingBack from http://www.biosensorab.org/2008/02/21/meet-the-parallel-activity/Anonymous
February 21, 2008
nice..you seem to be one of only a couple people (in .NET land) i've seen separate their interfaces from their classes (a good thing)..just an observation.. I know Juval and Udi both do it, but it seems to be a concept lost on nearly everyone else (although now I'd put you in that list).. Evan