Chapter 30: Windows Workflow Foundation


Overview

A workflow, in the generic sense, consists of the series of stages that a piece of work passes through while it is still active. Optionally, you can consider the inactive stage (where the work is archived or even deleted) as a final stage.

For example, consider a bug tracking system. The workflow starts when a customer files a bug report. Someone evaluates the bug to determine generally where it lies and how serious it is. The bug enters a work queue in a position that depends on its severity (high-priority bugs may go to the top of the queue).

When the bug reaches the top of the queue, it is assigned to a developer. The developer tries to reproduce the bug. If the bug cannot be reproduced, the developer sends it back to the customer for clarification. Otherwise, the developer fixes the bug and flags it as fixed.

Next, a tester performs a series of tests to see if the bug has been fixed, and to ensure that the new code didn’t break anything else. If there are no problems, the tester flags the bug as ready for release to the customers. If there are still problems, the tester sends the bug back to the developer for further work.

Each of the people who performs actions in the workflow is called an actor. You can map the actors to the actions performed during the workflow. In this example, the actors include the user or customer who creates the bug report, the person who evaluates the bug and places it in the correct part of the queue, the person (or program) who assigns the bug to a developer, the developer who tests and fixes the bug, and the tester who verifies the fix.

Tip 

Sometimes a single person may play more than one role as an actor. In a small company, the same person may queue and assign bugs. Usually, the same engineer will reproduce and fix the bug, although it’s generally a bad idea to have the person who fixes the bug also test the fix.

Figure 30-1 shows a flowchart that represents this workflow. You can match the actors to the actions shown in the figure. In this diagram, the user who creates the bug report is shown explicitly, but the other actors are not.

image from book
Figure 30-1: This flowchart shows a simple bug-tracking workflow.

Windows Workflow Foundation (WF) is a tool that makes building workflow applications easier. It provides designers and classes that let you determine the activities that the workflow will use and their order.

The following section briefly describes some of WF’s key features. The section after that briefly describes the workflow activities currently defined by WF so that you will know the kinds of tools WF makes available to you. The section “A Sequential Example” near the end of the chapter describes a simplified bug-reporting example program to give you a sense of what a workflow built in Visual Basic looks like.




Visual Basic 2005 with  .NET 3.0 Programmer's Reference
Visual Basic 2005 with .NET 3.0 Programmer's Reference
ISBN: 470137053
EAN: N/A
Year: 2007
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net