I’m building a WPF application using prism and I’d like to use workflow foundation (both locally and from a service).
Does anyone have insight on building workflow activities invoked using the EventAggretator and then have workflow publish events in response? I’m considering building an implementation that would allow an activity to publish one to many events, is this a good scenario for workflow?
One way you can implement using an event aggregator is to require it as an extension to your workflow activities like the following. In your WorkflowApplication / WorkflowInvoker, you can then register an instance of the event aggregator so that your activities can raise the events. I haven’t used the event aggregator (yet) in my apps, so there might be some quirks.
Custom Activity that requires an event aggregator and uses it in its Execute method:
Registering the event aggregator instance for use in your activities:
Hope that helps.
EDIT: I found this video that shows building an event driven +long running workflow that might be of some help as well. I haven’t watched it yet though: http://channel9.msdn.com/Events/Build/BUILD2011/TOOL-801T