Viacheslav Eremin | Visual Studio 2010 and .NET Framework 4 Training Kit | Introduction To Windows Workflow Foundation in .NET 4







Hands-On Lab

Introduction To Windows Workflow Foundation in .NET 4



Lab version:1.0.0

Last updated:1/4/2011






Contents

Overview

Exercise 1: Hello Workflow

Task 1 � Creating a Simple Hello Workflow Application

Exercise 1 Verification

Exercise 2: Refactoring Workflow

Task 0 � Opening the Solution

Task 1 � Renaming Workflow1 to SayHello

Task 2 � Updating the Main Method to Use the New Name

Exercise 2: Verification

Exercise 3: The CodeActivity

Task 0 � Opening the Solution

Task 1 � Creating the SayHelloInCode Activity

Task 2 � Updating Main to Invoke SayHelloInCode

Exercise 3: Verification

Exercise 4: Dynamic Workflows with XAML

Task 0 � Opening the Solution

Task 1 � Modifying SayHello.xaml Files Properties

Task 2 � Modifying Main() to Load the SayHello.xaml File

Exercise 4: Verification

Exercise 5: Testing Workflows

Task 0 � Opening the Solution

Task 1 � Creating the Unit Test Project

Task 2 � Creating the Test

Task 3 � Getting the Application to Compile

Task 4 � Seeing the Test Fail

Task 5 � Making the Test Pass

Exercise 5: Verification

Exercise 6: WorkflowApplication

Task 0 � Opening the Solution

Task 1 � Writing the Test to Verify that the Workflow Thread ID is Returned as an Out Argument

Task 2 � Returning the WorkflowThread as an Argument

Task 3 � Modifying the Test to use WorkflowApplication

Exercise 6: Verification

Exercise 7: If/Else Logic

Task 0 � Opening the Solution

Task 1 � Writing the Test for a New Requirement

Task 2 � Implementing the New Requirement in the Workflow

Exercise 7: Verification

Exercise 8: Error Handling

Task 0 � Opening the Solution

Task 1 � Writing a Test to Observe Error Behavior

Task 2 � Adding the Try/Catch Activity to the Workflow

Exercise 8: Verification

Exercise 9: Custom Activities and Designers

Task 0 � Opening the Solution

Task 1 � Add Activity Designer Library

Task 2 � Create Composite Activity in XAML

Task 3 � Add Existing Activities

Task 4 � Observe Custom Activities without Designers

Task 5 � Explore Activity Designers

Task 6 � Linking the Activity Designers to the Activity

Exercise 9: Verification

Task 1 � Prepare the test projects

Task 2 � Create DiagnosticTrace Test

Task 3 � Add a DiagnosticTrace activity to the SayHello Workflow

Task 4 � Add the PrePostSequence Test

Exercise 10: Hosted Designer

Task 0 � Opening the Solution

Task 1 � Adding new WPF Application

Exercise 10: Verification

Summary