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.

image

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).