Chapter 25: Windows Workflow Foundation


While Windows Communication Foundation and Windows Presentation Foundation enjoy much of the attention, the .NET Framework 3.0 also comes with another “Foundation”: Windows Workflow Foundation (usually abbreviated WF). WF can be a powerful tool in developing applications, as it provides a standard means of adding workflow to an application. Workflow refers to the steps involved in an application. Most business applications contain one or more workflows, such as the approval steps in an expense-tracking application, or the steps involved in paying for a cart full of items at an online store. Normally, a workflow is created in code, and is inextricably bound to the application. WF enables developers to graphically build the workflow, keeping it logically separated from the code itself. It also enables the workflow to change as the needs of the business change. These workflows may be as complex as needed, and may integrate human processes or Web Services.

This chapter looks at how you can take advantage of WF in your applications: how you can add and edit workflows, how you can integrate workflows into an existing business process, and how the graphical tools used to build workflows with Visual Studio can help you communicate with business users and avoid errors caused by mistakes in the workflow.

Workflow in Applications

Just what is workflow? It’s a very heavily used word, and many developers use it in multiple contexts. For our purposes, it is the description of the steps involved in some process performed at least partially by a computer. Workflows are common in many types of business applications. For example, if you were building an application for tracking employee expense reports, the workflow might look something like the following:

  1. The employee completes a form and submits it into the system.

  2. The employee prints the expense report form, attaches original invoices, and sends it to accounting for a permanent record.

  3. The system examines the data in the expense report:

    1. Depending on the rules defined by the company, it may be automatically approved, require management approval, or require investigation by the accounting department. Some of the rules that may come into play would likely be the expense types, the amount of each expense, how the expense was paid, and so on.

    2. Copies of the expense report are e-mailed if additional approval is required.

    3. If approved, the expense report continues in the workflow; otherwise, it is returned to the submitting employee for correction (or to complain to the employee’s manager).

  1. Expense report values are recorded in the accounting system.

  2. A check is printed and sent to the happy employee. This step may be delayed if the originals have not been received. Alternatively, the company may delay future expense reimbursement requests.

The steps in a workflow may be carried out by a human or computer; they may require custom code or calculations, or may need to integrate with an external application. Building workflows into an application is frequently a difficult process. Unless developers completely understand the process (and they rarely do), identifying the true workflow used for a process requires interviewing multiple people at one or more companies. This often results in conflicting descriptions of the steps involved, or of the actions required at each step, requiring someone to decide on the actual intent.

Even after the exact workflow has been defined, it frequently changes. This may be due to some new legal requirements, a company merger, or even (frequently) the whims of management. In traditional applications, this would likely mean that a developer would have to change the code for one or more steps of the process, ideally without introducing any new bugs into the system. In short, developing workflow applications using traditional tools can be a difficult process. WF makes building and maintaining these workflows easier by abstracting away the logic of the workflow, and by providing several of the common services required.




Professional VB 2005 with. NET 3. 0
Professional VB 2005 with .NET 3.0 (Programmer to Programmer)
ISBN: 0470124709
EAN: 2147483647
Year: 2004
Pages: 267

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