Before we look at how to use Microsoft WF, you may be wondering why you should bother.
WF can greatly simplify the development of applications that deal with complex and long-running processes, as traditional coding methods are not ideal for solving this type of problem.
To understand why they are not, let's take the example of a visa approval system (loosely based on my experience of the UK/Australian emigration process), as shown in the flowchart in Figure 6-1.
Even if you have no experience with the Australian emigration process, you can probably gain an understanding from Figure 6-1. Windows Workflow enables you to design and develop your application in a similar visual manner. Consider how an application to handle such a process would be coded: it would probably be difficult to gain an understanding at a glance. Figure 6-2 shows a possible WF implementation of the process. As you can see, it's not so different from Figure 6-1.
Now let's consider some of the issues we may encounter when developing this application:
The client wants to process visa applications as quickly as possible, so he wants to alert staff when an application is ready for the next stage. How will you provide this functionality in an efficient and timely manner when processing hundreds of thousands of applications?
How will you pass data between different services and government departments, such as performing a police check on an applicant?
Some tasks take a long time to complete or require human intervention before they can proceed. How will you handle this waiting?
A typical visa will take weeks or months to process. How are you going to store the current state of a visa application?
What will happen to an application in the event of system failure?
How will you design your application so that it is flexible enough to accommodate future changes?
Imagine you need to debug and monitor different stages of the approval process; how will you do this?
Agggrahh! As you can see, even a simple process can get very complex quickly. Of course, you can develop such an application very successfully (and many have) using current technologies, but Windows Workflow has many built-in features to handle some of this complexity.
18.226.164.216