Lesson 1: Getting Started
This is the first of six tasks that introduces the functionality of Windows Server AppFabric.
Objective: To prepare for running the tutorial. AppFabric is not a stand-along application. Instead, it is designed to monitor and manage Windows Workflow applications that run as Windows Communication Foundation services. Because of this the tutorial includes a functioning workflow application that needs to deployed on the computer running the tutorial.
Purpose: In this lesson, you install the tutorial files, and run a wizard that checks for the necessary software on your computer.
Prerequisites
Install AppFabric. For more information, see Introduction.
Install the HRContoso solution. The download is at WF4 Workflow Services / AppFabric Sample - Contoso HR
Run the CheckDependencies command (below).
Running the CheckDependencies command
Once you have successfully installed the HRContoso solution on your computer, you must run a wizard that will check for dependencies and create special databases required for the application.
On the Start menu click All Programs, then click Microsoft Visual Studio 2010 and open the Visual Studio Tools folder. Right-click Visual Studio Command Prompt (2010) and click Run as Administrator.
Navigate to the folder named Setup. The relative path is \ContosoHR\Setup
Type CheckDependencies.cmd and press Enter to run the wizard.
The wizard checks for the presence of required software including Visual Studio 2010, Windows Powershell, and .NET Framework 4. The underlying scripts then creates two new databases using SQL Express: WF4Persistence and HRApplicationData.
The Contoso Hiring Workflow
In this simple scenario, the Contoso company has a website that allows prospects to begin the application process for a positon with the company. The applicant fills in a name and email address field, and a field for education level. The possible values for the education level include None, Bachelors, Masters, and Doctorate. After the applicant completes the form the workflow tests for the level of education. If it is too low, then the applicant is sent a message indicating that the requirements are not met. If the minimum requirements are met, then a human must decide whether or not to hire the applicant. In a long-running workflow, this may take days. Once a decision is made, a message is mailed informing the applicant of the decision.
The graphic below shows the components of the workflow.
The applicant fills out the online form and submits it.
The application is saved and the applicant’s education level is automatically assessed.
If the education meets the minimum level, a human reviewer is asked to make a hire or no hire decision. This step could take hours, if not days, to fulfill, during which time the workflow is in an idle state.
The final decision is logged.
The applicant is notified of the final decision.
The scenario described above is enabled by creating a Windows Workflow, which necessarily requires more steps to implement the human workflow. To more easily comprehend the Windows workflow, open the ContosoHR solution. Expand the HRApplicationServices project node. Double click SubmitApplication.xamlx to examine the workflow.
Note
To simplify the application, email messages are created and deposited in a directory named mailbox at the root level of the computer (<drive>:\mailbox). If the email message is created in the mailbox, it is considered to have been successfully “sent” by the workflow. The mailbox is created by the “Check Dependencies” wizard.
What AppFabric Does in this Scenario
AppFabric features a dashboard that is viewed by opening the Internet Information Services (IIS) Manager. (You will examine the dashboard fully in the following lessons.) Using the dashboard, you can see every instance of every step in every workflow running on a computer. If a workflow step fails for any reason, the activity is suspended and persisted. That is, the workflow step is captured in a database so it can be unloaded from memory, and recovered after the failure is remedied. Once the source of the failure is fixed, all suspended steps can be resumed. Because you can have hundreds of workflows, each with dozens of activities, running in a matter of days, the dashboard also allows you to query for only those instances that interest you. Completed workflows are also tracked in the dashboard. The number of completions allows you to measure the throughput of the system, and to identify bottlenecks or sources of failure.
In a nutshell, here are the benefits of using AppFabric to monitor and manage Web service workflows:
Workflows are automatically suspended on exception.
AppFabric tools assist in troubleshooting and fixing problems.
AppFabric allows for resuming workflows easily with tools and scripts.
Next Steps
Now that you have installed the sample application and run the scripts to set up the databases and mailbox, go to the next step Lesson 2: Deploying the HRApplicationServices Workflow Service.
See Also
Concepts
Lesson 2: Deploying the HRApplicationServices Workflow Service
Lesson 3: Configuring the HRApplicationServices Application
Lesson 4: Monitoring the Health of the HRApplicationServices Application
Lesson 5: Resuming a Suspended Workflow Using AppFabric