Book Image

Programming Windows Workflow Foundation: Practical WF Techniques and Examples using XAML and C#

By : Kenneth Scott Allen
Book Image

Programming Windows Workflow Foundation: Practical WF Techniques and Examples using XAML and C#

By: Kenneth Scott Allen

Overview of this book

Windows Workflow Foundation (WF) is a technology for defining, executing, and managing workflows. It is part of the .NET Framework 3.0 and will be available natively in the Windows Vista operating system. Windows Workflow Foundation might be the most significant piece of middleware to arrive on the Windows platform since COM+ and the Distributed Transaction Coordinator. The difference is, not every application needs a distributed transaction, but nearly every application does have a workflow encoded inside it. In this book, K Scott Allen, author of renowned .NET articles at www.odetocode.com, provides you with all the information needed to develop successful products with Windows Workflow. From the basics of how Windows Workflow can solve the difficult problems inherent in workflow solutions, through authoring workflows in code, learning about the base activity library in Windows Workflow and the different types of workflow provided, and on to building event-driven workflows using state machines, workflow communications, and finally rules and conditions in Windows Workflow, this book will give you the in-depth information you need. Throughout the book, an example "bug reporting" workflow system is developed, showcasing the technology and techniques used.
Table of Contents (14 chapters)
Programming Windows Workflow Foundation: Practical WF Techniques and Examples using XAML and C#
Credits
About the Author
About the Reviewer
Preface

Local Communication Services Redux


We know that local communication services allow workflows to exchange data with their host process. In Chapter 3, we defined a service that raised a BugAdded event to a running workflow, which in turn invoked an AssignBug method on the service. The service sent data to the workflow via the event, and the workflow sent data to the service by invoking a method.

The screenshot above shows how the workflow runtime acts as a broker between the local communication service and a workflow instance. The runtime intercepts events from the local service and directs the events to the proper workflow instance. This interception is necessary because the workflow instance waiting for the event might have been unloaded from memory and persisted to a database table. The runtime can ask the persistence service to reload the workflow before it delivers an event, but it needs a workflow instance ID first. Even if the workflow is still in memory, the runtime will need an instance...