Learn your way! Get started

Windows Workflow Foundation Using Visual Basic 2005

with experts Ken Getz, Robert Green


Course at a glance

Included in these subscriptions:

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

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


Enterprise Solutions
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 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 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 (40:04)
  • 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:29)
  • Two Types of Workflows (01:10)
  • Base Classes (00:31)
  • Workflow Activities (01:23)
  • Create First Workflow (03:36)
  • Workflow Activities (00:44)
  • Add Code Activities (02:29)
  • Test the Workflow (01:22)
  • Debug Your Workflow (01:27)
  • Workflow Architecture (03:08)
  • Types of Host Apps (00:39)
  • Workflow Startup Code (04:49)
  • Two Ways to Create Workflows (01:34)
  • Create Workflow w/XOML (04:32)
  • Summary (00:55)
Windows Form Host (17:16)
  • Introduction (01:24)
  • Hosting Workflow (00:12)
  • Pass Parameters (02:02)
  • Demo: Create Host App (01:25)
  • Demo: Create Workflow (01:18)
  • Add Amount/ItemName (01:11)
  • Set Delay Activity Behavior (00:18)
  • Add IfElse Activity Condition (01:41)
  • Add Code Activities (01:33)
  • Create the Form (01:10)
  • WorkFlowCompleted (00:23)
  • Create Parameters Coll. (02:26)
  • Test the Workflow (01:04)
  • Summary (01:01)
If / Else / While Conditions (21:18)
  • 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:15)
  • Demo: Conditional Expression (03:22)
  • Demo: Add/Remove Branches (00:26)
  • Demo: Use Code Conditions (05:10)
  • While Activity (00:51)
  • Demo: Use While Activity (04:08)
  • Summary (00:29)

Module 2

CAG / Replicator (26:25)
  • Introduction (00:48)
  • Overview: CAG (01:18)
  • Demo: CAG Activity (08:33)
  • Replicator Activity (01:51)
  • Demo: Replicator Activity (07:14)
  • Using a Custom Activity (01:03)
  • Demo: Custom Activity (04:50)
  • Summary (00:46)
Exception Handling (17:32)
  • Introduction (01:02)
  • Overview (00:58)
  • Use FaultHandler Activity (01:12)
  • Use Throw Activity (00:33)
  • Demo: Exceptions (02:09)
  • OnWorkflowTerminated Event (01:21)
  • Demo: FaultHandler Activity (05:21)
  • Demo: Throw Activity (04:26)
  • Summary (00:27)
Delay Activity (26:11)
  • Introduction (00:51)
  • Overview: Delay Activity (00:56)
  • TimeoutDuration (01:14)
  • Why Bind? (01:50)
  • Work with Delay Activity (01:16)
  • Work w/Enabled Property (00:17)
  • Set the Description Prop. (00:57)
  • Set the TimeoutDuration (04:52)
  • Set InitializeTimeoutDuration (00:43)
  • Bind to a Field (01:58)
  • Bind the TimeoutDuration (00:00)
  • Bind to a Property (04:24)
  • Bind to Dependency Prop. (04:17)
  • Multiple Instances (01:25)
  • Summary (01:04)

Module 3

Listen / Suspend / Terminate (30:07)
  • Introduction (01:17)
  • Listen Activity (02:48)
  • Demo: Listen Activity (05:28)
  • Review: Listen Activity (00:48)
  • Suspend and Terminate (00:35)
  • Suspend Activity (02:04)
  • Demo: Suspend Activity (09:34)
  • Terminate Activity (00:55)
  • Demo: Terminate Activity (05:37)
  • Summary (00:56)
Parallel (21:48)
  • Introduction (01:09)
  • Parallel Activity (02:00)
  • Demo: Parallel Activity (02:26)
  • Delay Activity (00:34)
  • Demo: Delay Activity (03:09)
  • Synchronize Access (00:44)
  • SynchronizationHandles (00:51)
  • Demo: SynchronizeScope (03:14)
  • Handling Cancellation (00:59)
  • Use Multiple Handlers (00:47)
  • Demo: CancellationHandler (02:47)
  • Demo: Multiple Handler (01:54)
  • Summary (01:07)
Rule Sets (23:52)
  • Introduction (00:47)
  • Overview: Workflow Rules (01:03)
  • Using a RuleSet (01:03)
  • Using a Policy Activity (00:38)
  • Demo: Policy Activity (02:19)
  • Associate RuleSet (00:18)
  • Demo: Define Rules (03:54)
  • Call Methods in Rules (01:03)
  • Demo: Call Methods (00:59)
  • View RuleSet Editor (02:43)
  • Setting Priorities (01:47)
  • Demo: Set Priorities (00:59)
  • Add New Rules (02:32)
  • Evaulate Rule Order (02:40)
  • Summary (01:01)

Module 4

Chaining (22:30)
  • Introduction (01:18)
  • Forward Chaining (00:46)
  • Demo: Forward Chaining (07:20)
  • Attribute Chaining (01:33)
  • Explicit Chaining (00:28)
  • Demo: Attribute Chaining (03:32)
  • Demo: Explicit Chaining (02:04)
  • Control Chaining (01:12)
  • Demo: Halt Chaining (03:08)
  • Summary (01:03)
Call Host Methods (26:01)
  • Introduction (01:08)
  • Overview: Host Methods (01:59)
  • Cross-Threading Issues (01:16)
  • Important Specifics (01:09)
  • Create a Console Host (01:22)
  • Create Shared Interface (01:59)
  • Create the Workflow (06:18)
  • Interface Implementation (02:23)
  • ExternalDataExchangeService (02:36)
  • Add Windows App Host (04:08)
  • Review: Host Methods (00:52)
  • Summary (00:44)
Handle Host Events (32:04)
  • Introduction (01:11)
  • Overview: Host Events (00:52)
  • Event Arguments (00:53)
  • Create a Solution (00:30)
  • Add EventArgs Class (03:06)
  • Create the Interface (01:35)
  • Create the Host App (01:18)
  • Interface Implementation (01:44)
  • Hook up the Events (00:52)
  • Create the Workflow (05:06)
  • Raise the Event (04:58)
  • Bi-Directional Comm. (01:02)
  • Modify the Interface (00:29)
  • Modify the Implementation (02:21)
  • Modify the Workflow (05:00)
  • Summary (01:00)

Module 5

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

Module 6

Custom Persistence (35:25)
  • Introduction (01:11)
  • Overview: Persistence (01:26)
  • Demo: Persistence Service (03:55)
  • Create Persistence Service (00:07)
  • MyTimerList Class (08:41)
  • MyFilePersistenceService Cls. (11:08)
  • Handle Timer Expiration (01:46)
  • Create the Timer List (04:17)
  • Reload Persistence Service (02:05)
  • Summary (00:45)
Tracking Services (34:58)
  • Introduction (00:51)
  • Overview: Tracking Services (00:56)
  • SqlTrackingService (00:21)
  • Tracking Events (00:28)
  • Using SqlTracking Service (00:57)
  • Set up SQL Tracking (01:58)
  • Add Tracking to Workflow (00:42)
  • Query Data by Hand (04:38)
  • Query Data with Code (00:44)
  • SqlTrackingWorkflowInstance (00:21)
  • Tracking Records (06:45)
  • Create Tracking Points (03:55)
  • Track Evaluation of Rules (07:28)
  • User Config. File (01:22)
  • Setup Config. File (03:03)
  • Summary (00:23)

Module 7

Tracking Profiles (38:19)
  • 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:33)
  • Create Profile in XML (05:24)
  • Tracking Profile in Code (03:15)
  • Define Workflow Events (01:15)
  • Define Activity Events (01:13)
  • Extract Workflow Fields (01:58)
  • Define User Events (01:05)
  • Save Profile to Database (02:52)
  • Display Tracking Data (03:43)
  • Track Profile Version (03:47)
  • Modify a Profile (04:06)
  • Delete a Profile (03:07)
  • Summary (00:37)
Custom Tracking Service (15:35)
  • Introduction (01:04)
  • Overview (00:59)
  • TrackingChannel Class (00:22)
  • TrackingService Class (01:05)
  • Create Custom Service (09:27)
  • Build Custom Service (00:08)
  • Test Custom Service (01:45)
  • Summary (00:41)
Intro to Custom Activities (20:02)
  • Introduction (01:07)
  • Custom Activites (00:32)
  • Why Create Activites? (01:05)
  • Simple vs. Composite (00:32)
  • Create Simple Activity (02:01)
  • Add Dependency Props (01:12)
  • wdp shortcut (02:01)
  • Add Functionality (01:03)
  • Test the Activity (01:00)
  • Dependency Properties (02:03)
  • Set Default Values (01:32)
  • Set the Display Name (05:07)
  • Summary (00:42)

Module 8

More Complex Activity (38:50)
  • Introduction (00:48)
  • LoadTextFile Activity (03:32)
  • Test LoadTextFile Activity (04:55)
  • Add Toolbox Bitmap (00:39)
  • Demo: Toolbox Bitmap (03:57)
  • Add a Validator (00:55)
  • Demo: Add a Validator (09:28)
  • Add a Designer (01:04)
  • Demo: Add a Designer (05:57)
  • Modify Activity Theme (00:45)
  • Demo: Investigate Themes (00:47)
  • Demo: Create New Theme (04:45)
  • Summary (01:11)
Composite Activities (09:42)
  • Introduction (00:49)
  • Overview (00:29)
  • Create Composite Activity (01:09)
  • Add DisplayFileToConsole (01:07)
  • Use Property Promotion (00:53)
  • Demo: Property Promotion (04:04)
  • Summary (01:08)
Transactions (23:05)
  • Introduction (01:06)
  • Overview: Transactions (01:34)
  • Transactions in Workflows (00:25)
  • TransactionScope Activity (02:17)
  • Transactions in Workflows (07:42)
  • Transaction Batches (01:49)
  • Demo: Using Batches (07:36)
  • Summary (00:33)

Module 9

Compensation (22:30)
  • Introduction (02:10)
  • Overview (01:31)
  • CompensatableTransaction... (00:45)
  • Demo: CompensatableTran... (09:19)
  • Compensate Activity (01:14)
  • Demo: Compensate (03:54)
  • CompensatableSequence (00:28)
  • Demo: CompensatableSeq... (02:48)
  • Summary (00:17)
Dynamic Updates (29:52)
  • Introduction (01:19)
  • Overview (02:46)
  • Perform Dynamic Updates (00:37)
  • 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 (02:21)
  • Investigate Host Application (04:07)
  • Add an Activity (03:48)
  • Delete activity (01:17)
  • Restrict Workflow Changes (02:32)
  • Modify from Workflow (01:34)
  • Re-Investigate Workflow (02:03)
  • Re-Investigate Host App (01:14)
  • Summary (01:10)
Dynamic Rule Conditions (18:08)
  • Introduction (01:03)
  • Overview: DRC (00:33)
  • Examine .rules File (00:46)
  • Modify Rule Condition (00:41)
  • Demo: Modify Rule (06:49)
  • Replace All Rule Conditions (01:43)
  • Demo: Replace All Rules (05:30)
  • Summary (00:59)

Module 10

Workflows as Web Services (25:43)
  • Introduction (01:03)
  • Overview (00:51)
  • WebServiceInput Activity (00:49)
  • WebServiceOutput Activity (00:53)
  • Build a Web Service (00:35)
  • Create the Interface (01:25)
  • Create the Workflow (05:39)
  • Publish Web Service (01:52)
  • Test the Web Service (02:00)
  • WebServiceFault Activity (01:18)
  • Add Validation (04:12)
  • Add a Win App Host (03:39)
  • Test Win App Host (00:45)
  • Summary (00:36)
Maintaining State (14:08)
  • Introduction (00:52)
  • Overview (01:21)
  • Add WS Input/Output (05:24)
  • Test Web Service (01:13)
  • Modify Client Form (00:50)
  • Run the Web Service (00:55)
  • Maintain Web Service State (01:02)
  • Store State On Client (01:54)
  • Summary (00:33)
Invoking Web Services (13:11)
  • Introduction (00:36)
  • Invoke a Web Service (01:21)
  • Demo: Invoke a WS (08:33)
  • Demo: Add Fault Handling (02:09)
  • Summary (00:31)