Learn your way! Get started

Windows Workflow Foundation Using Visual C# 2005

with experts Ken Getz, Robert Green


Course at a glance

Included in these subscriptions:

  • Dev & IT Pro Video
  • Dev & IT Pro Power Pack

Release date 6/15/2007
Level Advanced
Runtime 11h 59m
Closed captioning N/A
Transcript N/A
eBooks / courseware Included
Hands-on labs Included
Sample code Included
Exams Included
Platform Internet Explorer Only


Enterprise Solutions

Need reporting, custom learning tracks, or SCORM? Learn More



Course description

Microsoft has provided the Windows Workflow Foundation, a set of assemblies based on the .NET Framework 2.0 (as part of the .NET Framework 3.0), along with a full-featured workflow designer built on top of Visual Studio 2005, and it’s free.Windows Workflow Foundation makes it easy to create applications that follow a flow, or react to events and move from state to state. By providing a visual interface for designing the applications, and by binding code activities directly to the design of the application, Windows Workflow Foundation makes it easier than ever to create and maintain complex business applications.In addition, Windows Workflow Foundation provides a runtime engine that manages your application’s behavior (that is, the “plumbing”) and enforces the workflow. The runtime makes sure the workflow behaves in the manner in which you designed and coded it.

Meet the experts

Ken Getz is a featured instructor for several of our Visual Studio courses. He is a Visual Basic and Visual C# expert and has been recognized multiple times as a Microsoft MVP. Ken is a seasoned instructor, successful consultant, and the author or co-author of several best-selling books. He is a frequent speaker at technical conferences like Tech-Ed, VSLive, and DevConnections and he has written for several of the industry's most-respected publications including Visual Studio Magazine, CoDe Magazine, and MSDN Magazine.

Robert Green is a Visual Studio expert and a featured instructor for several of our Visual Basic and Visual C# courses. He is currently a Technical Evangelist in the Developer Platform and Evangelism (DPE) group at Microsoft. He has also worked for Microsoft on the Developer Tools marketing team and as Community Lead on the Visual Basic team. Robert has several years of consulting experience focused on developer training and is a frequent speaker at technology conferences including TechEd, VSLive, VSConnections, and Advisor Live.

Course outline



Module 1

Workflow Foundation (37:41)
  • Introduction (01:44)
  • Overview: WF (05:43)
  • What App Types Benefit (01:33)
  • What is Needed for WF (02:08)
  • Verify Pieces are Installed (00:33)
  • Two Types of Workflows (01:11)
  • Base Classes (00:30)
  • Activity Controls (01:23)
  • Create First Workflow (03:14)
  • Workflow Activities (00:12)
  • Add Code Activities (01:57)
  • Test the Workflow (00:50)
  • Debug Your Workflow (01:12)
  • Workflow Architecture (03:08)
  • Types of Host Apps (00:39)
  • Workflow Startup Code (04:35)
  • Two Ways of Create Workflows (01:35)
  • Create Workflow w/XOML (04:31)
  • Summary (00:55)
Windows Form Host (18:30)
  • Introduction (01:24)
  • Hosting Workflow (00:12)
  • Passing Parameters (02:03)
  • Create the Host App (01:24)
  • Create the Workflow (01:21)
  • Add Amount/ItemName (01:12)
  • Set Delay Activity Behavior (00:18)
  • Add IfElse Activity Condition (01:59)
  • Add Code Activities (01:37)
  • Create the Form (01:23)
  • Create Parameters Coll. (01:55)
  • WorkFlowCompleted (00:40)
  • Test the Workflow (01:53)
  • Summary (01:01)
If / Else / While Conditions (19:23)
  • Introduction (00:32)
  • Overview: Conditions (00:58)
  • IfElse Activity (01:11)
  • Add/Remove IfElse Branches (00:30)
  • Use Conditional Expression (00:49)
  • Use Methods as a Condition (00:32)
  • Demo: IfElse Activity (02:04)
  • Demo: Conditional Expression (01:56)
  • Demo: Add/Remove Branches (00:16)
  • Demo: Use Code Conditions (05:07)
  • While Activity (00:51)
  • Demo: Use While Activity (04:04)
  • Summary (00:29)

Module 2

CAG / Replicator (25:50)
  • Introduction (00:48)
  • Overview: CAG (01:18)
  • Demo: CAG Activity (07:53)
  • Replicator Activity (01:51)
  • Demo: Replicator Activity (07:24)
  • Using a Custom Activity (01:03)
  • Demo: Custom Activity (04:44)
  • Summary (00:46)
Exception Handling (19:31)
  • Introduction (01:02)
  • Overview (00:58)
  • Use FaultHandler Activity (01:12)
  • Use Throw Activity (00:33)
  • Demo: Exceptions (03:22)
  • OnWorkflowTerminated Event (01:01)
  • Demo: FaultHandler Activity (06:11)
  • Demo: Throw Activity (04:42)
  • Summary (00:27)
Delay Activity (24:07)
  • Introduction (00:51)
  • Overview: Delay Activity (00:56)
  • TimeoutDuration (01:14)
  • Why Bind? (01:50)
  • Work with Delay Activity (01:03)
  • Work w/Enabled Property (00:19)
  • Set the Description Prop. (00:36)
  • Set the TimeoutDuration (03:50)
  • Set InitializeTimeoutDuration (02:02)
  • Bind the TimeoutDuration (01:06)
  • Bind to a Field (01:53)
  • Bind to a Property (01:46)
  • Bind to Dependency Prop. (04:02)
  • Multiple Instances (01:28)
  • Summary (01:04)

Module 3

Listen / Suspend / Terminate (29:36)
  • Introduction (01:17)
  • Listen Activity (02:49)
  • Demo: Listen Activity (06:06)
  • Review: Listen Activity (00:48)
  • Suspend and Terminate (00:35)
  • Suspend Activity (02:04)
  • Demo: Suspend Activity (07:31)
  • Terminate Activity (00:56)
  • Demo: Terminate Activity (06:31)
  • Summary (00:56)
Parallel (22:46)
  • Introduction (01:09)
  • Parallel Activity (02:00)
  • Demo: Parallel Activity (02:20)
  • Delay Activity (00:34)
  • Demo: Delay Activity (03:59)
  • Synchronize Access (00:44)
  • SynchronizationHandles (00:51)
  • Demo: SynchronizeScope (02:53)
  • Handling Cancellation (00:59)
  • Use Multiple Handlers (00:47)
  • Demo: CancellationHandler (03:18)
  • Demo: Multiple Handler (01:58)
  • Summary (01:07)
Rule Sets (23:47)
  • Introduction (00:47)
  • Overview: Workflow Rules (01:03)
  • Using a RuleSet (01:03)
  • Using a Policy Activity (00:38)
  • Demo: Policy Activity (01:36)
  • Associate RuleSet (00:26)
  • Demo: Define Rules (03:32)
  • Call Methods in Rules (01:03)
  • Demo: Call Methods (01:20)
  • View RuleSet Editor (02:51)
  • Setting Priorities (01:47)
  • Demo: Set Priorities (01:01)
  • Add New Rules (02:28)
  • Evaluate Rule Order (03:05)
  • Summary (01:01)

Module 4

Chaining (23:35)
  • Introduction (01:18)
  • Forward Chaining (00:46)
  • Demo: Forward Chaining (08:10)
  • Attribute Chaining (01:47)
  • Explicit Chaining (00:14)
  • Demo: Attribute Chaining (03:10)
  • Demo: Explicit Chaining (02:39)
  • Control Chaining (01:12)
  • Demo: Halt Chaining (03:10)
  • Summary (01:03)
Host Methods (25:12)
  • Introduction (01:08)
  • Overview: Host Methods (01:59)
  • Cross-Threading Issues (01:16)
  • Important Specifics (01:09)
  • Create a Console Host (01:01)
  • Create Shared Interface (02:25)
  • Create the Workflow (05:08)
  • Interface Implementation (01:08)
  • ExternalDataExchangeService (03:43)
  • Add Windows App Host (04:33)
  • Review: Host Methods (00:51)
  • Summary (00:44)
Host Events (32:27)
  • Introduction (01:11)
  • Overview: Host Events (00:52)
  • Event Arguments (00:53)
  • Create a Solution (00:21)
  • Add EventArgs Class (02:47)
  • Create the Interface (01:14)
  • Create the Host App (01:24)
  • Interface Implementation (02:41)
  • Hook up the Events (01:16)
  • Create the Workflow (05:46)
  • Raise the Event (04:07)
  • Bi-Directional Comm. (01:02)
  • Modify the Interface (00:38)
  • Modify the Implementation (02:35)
  • Modify the Workflow (04:31)
  • Summary (01:00)

Module 5

State Machines (30:53)
  • Introduction (01:08)
  • Overview: State Machines (02:03)
  • State Activity (00:48)
  • SetState Activity (00:44)
  • StateInitialization Activity (00:41)
  • StateFinalization Activity (00:28)
  • EventDriven Activity (01:15)
  • Create a State Machine WF (00:12)
  • Create Workflow States (02:36)
  • Define State Transitions (02:12)
  • Create the EventArgs Class (02:22)
  • Create an Interface (01:20)
  • Create Host Application (01:40)
  • Implement Host Interface (02:15)
  • Examine the Form Code (00:52)
  • Complete the Workflow (07:11)
  • Run the Application (01:27)
  • Summary (01:31)
Work with State Machines (08:27)
  • Introduction (00:36)
  • Circular Navigation (01:23)
  • Demo: Circular Navigation (04:15)
  • Interact w/State Machine (00:48)
  • StateMachineWorkflowInst... (00:47)
  • Summary (00:36)
Intro to Persistence (44:48)
  • Introduction (01:03)
  • Overview (00:53)
  • Save / Restore State (01:03)
  • Examine Sample Workflow (03:23)
  • View Workflow Project (02:45)
  • View Host Application (00:09)
  • WorkflowRuntime Events (01:15)
  • Start Workflow Runtime (01:40)
  • Create / Unload Workflows (00:58)
  • Release Workflow (00:27)
  • View app.config (01:17)
  • Life without Persistence (01:45)
  • Unloading Workflows (01:50)
  • What About Timers (01:02)
  • Unload vs TryUnload (02:27)
  • SQL Persistence Service (01:10)
  • Setup SQL Persistence (03:15)
  • SqlWorkflowPersistence (03:31)
  • Automatic Unloadon Idle (00:59)
  • Modify Load Interval (01:18)
  • Ownership Duration (00:40)
  • Hooking up Persistence (02:23)
  • Persist from Config File (04:56)
  • Run 2 Persistance Services (01:13)
  • Persistence / Serialization (02:27)
  • Summary (00:49)

Module 6

Custom Persistence (29:49)
  • Introduction (01:11)
  • Overview: Persistence (01:26)
  • Demo: Persistence Service (02:33)
  • Create Persistence Service (00:09)
  • MyTimerList Class (07:22)
  • MyFilePersistenceService Cls. (09:06)
  • Handle Timer Expiration (01:44)
  • Create the Timer List (03:26)
  • Reload Persistence Service (02:04)
  • Summary (00:45)
Tracking Services (35:26)
  • Introduction (00:51)
  • Overview: Tracking Services (00:56)
  • SqlTrackingService (00:21)
  • Tracking Events (00:28)
  • Using SqlTracking Service (00:56)
  • Set up SQL Tracking (01:58)
  • Add Tracking to Workflow (00:42)
  • Query Data by Hand (04:59)
  • Query Data w/Code (00:43)
  • SqlTrackingWorkflowInstance (00:20)
  • Tracking Records (06:47)
  • Create Tracking Points (03:49)
  • Track Evaluation of Rules (07:33)
  • User Config. File (01:22)
  • Setup Config. File (03:10)
  • Summary (00:23)

Module 7

Tracking Profiles (39:11)
  • Introduction (00:31)
  • Overview (01:02)
  • Default Tracking Profile (00:15)
  • Custom Tracking Profiles (00:57)
  • Tracking Profile in XML (00:30)
  • View Default Profile (02:31)
  • Create Profile in XML (04:36)
  • Tracking Profile in Code (02:18)
  • Define Workflow Events (02:05)
  • Define Activity Events (01:04)
  • Extract Workflow Fields (02:58)
  • Define User Events (01:42)
  • Save Profile to Database (01:36)
  • Display Tracking Data (05:05)
  • Track Profile Version (03:45)
  • Modify a Profile (04:10)
  • Delete a Profile (03:19)
  • Summary (00:37)
Custom Tracking Service (14:47)
  • Introduction (01:04)
  • Overview (00:59)
  • TrackingChannel Class (00:22)
  • TrackingService Class (01:05)
  • Create Custom Service (07:48)
  • Build Custom Service (00:40)
  • Test Custom Service (02:06)
  • Summary (00:41)
Intro to Custom Activities (21:13)
  • Introduction (01:07)
  • Custom Activities (00:32)
  • Why Create Activities? (01:05)
  • Simple vs. Composite (00:32)
  • Create Simple Activity (02:34)
  • Add Dependency Props (01:22)
  • wdp shortcut (00:50)
  • Add Functionality (02:22)
  • Test the Activity (01:55)
  • Dependency Properties (02:03)
  • Set Default Values (01:25)
  • Set the Display Name (04:39)
  • Summary (00:42)

Module 8

More Complex Activity (39:31)
  • Introduction (00:48)
  • LoadTextFile Activity (04:01)
  • Test LoadTextFile Activity (05:41)
  • Add Toolbox Bitmap (00:40)
  • Demo: Toolbox Bitmap (04:40)
  • Add a Validator (00:55)
  • Demo: Add a Validator (07:39)
  • Add a Designer (01:04)
  • Demo: Add a Designer (06:26)
  • Modify Activity Theme (00:45)
  • Demo: Investigate Themes (01:26)
  • Demo: Create New Theme (04:09)
  • Summary (01:11)
Composite Activities (10:40)
  • Introduction (00:49)
  • Overview (00:29)
  • Create Composite Activity (01:17)
  • Add DisplayFileToConsole (00:54)
  • Use Property Promotion (00:53)
  • Demo: Property Promotion (05:07)
  • Summary (01:08)
Transactions (22:05)
  • Introduction (01:06)
  • Overview: Transactions (01:34)
  • Transactions in Workflows (00:26)
  • TransactionScope Activity (02:17)
  • Transactions in Workflows (07:52)
  • Transaction Batches (01:47)
  • Demo: Using Batches (06:26)
  • Summary (00:33)

Module 9

Compensation (21:13)
  • Introduction (02:10)
  • Overview (01:31)
  • CompensatableTransaction... (00:45)
  • Demo: CompensatableTran... (08:22)
  • Compensate Activity (01:14)
  • Demo: Compensate (03:48)
  • CompensatableSequence (00:27)
  • Demo: CompensatableSeq... (02:34)
  • Summary (00:17)
Dynamic Updates (27:54)
  • Introduction (01:19)
  • Overview (02:46)
  • Perform Dynamic Updates (00:36)
  • Update from Workflow (00:38)
  • Update from Host App (00:58)
  • Steps to Update a Workflow (01:52)
  • Restrict Updates (00:24)
  • Modify from Host App (01:01)
  • Investigate Workflow (01:51)
  • Investigate Host Application (03:50)
  • Add an Activity (02:56)
  • Delete Activity (01:12)
  • Restrict Workflow Changes (02:34)
  • Modify from Workflow (01:34)
  • Re-Investigate Workflow (01:53)
  • Re-Investigate Host App (01:09)
  • Summary (01:10)
Dynamic Rule Conditioning (17:36)
  • Introduction (01:03)
  • Overview: DRC (00:33)
  • Examine .rules File (00:46)
  • Modify Rule Condition (00:41)
  • Demo: Modify Rule (06:51)
  • Replace All Rule Conditions (01:43)
  • Demo: Replace All Rules (04:57)
  • Summary (00:59)

Module 10

Workflows as Web Services (25:21)
  • Introduction (01:03)
  • Overview (00:51)
  • WebServiceInput Activity (00:49)
  • WebServiceOutput Activity (00:53)
  • Build a Web Service (00:35)
  • Create the Interface (01:39)
  • Create the Workflow (05:31)
  • Publish Web Service (02:08)
  • Test the Web Service (02:17)
  • WebServiceFault Activity (01:18)
  • Add Validation (03:46)
  • Add a Win App Host (03:01)
  • Test Win App Host (00:48)
  • Summary (00:36)
Maintaining State (16:11)
  • Introduction (00:52)
  • Overview (01:21)
  • Add WS Input/Output (05:33)
  • Test Web Service (01:27)
  • Modify Client Form (01:48)
  • Run the Web Service (01:07)
  • Maintain Web Service State (01:03)
  • Store State On Client (02:22)
  • Summary (00:33)
Invoking Web Services (11:27)
  • Introduction (00:36)
  • Invoke a Web Service (01:20)
  • Demo: Invoke a WS (06:51)
  • Demo: Add Fault Handling (02:07)
  • Summary (00:31)