learnWorkflow: chapter overview

chapter overview

The material in this book is a WF 4 tutorial presented in 18 chapters, with each chapter building upon the ones before it. I’ve tried to organize the material so that you don’t have to jump ahead in order to understand how something works. But since the chapters build upon each other, I do assume that you have read each chapter in order and understand the material that has already been presented.

The short sections that follow provide a brief summary of each chapter.

chapter 1: a quick tour of windows workflow foundation

This chapter provides a brief introduction to WF. In this chapter, you jump right in and develop your first workflow (“Hello Workflow”). You are introduced to some of the fundamental concepts of WF, such as how to pass parameters to a workflow and how to make decisions within a workflow.

chapter 2: foundation overview

The goal of this chapter is to provide a high-level overview of WF in its entirety. This chapter doesn’t teach you how to use each individual WF feature, but it does acquaint you with the design-time and runtime features that are available with WF. This chapter is a road map for the material that is covered in the remainder of the book.

chapter 3: activities

Activities are the building blocks of WF and where you place the business logic that is specific to your particular problem domain. In this chapter, you will learn how to develop your own custom activities using the base classes that ship with WF. This chapter also provides a high-level review of the standard activities that are provided with WF.

chapter 4: workflow hosting

WF is not a stand-alone application. It is a framework for building your own workflow-enabled applications. This chapter demonstrates how to host and execute workflows in your own application. It describes how to use each of the hosting classes that are supplied with WF.

chapter 5: procedural flow control

WF includes support for two different workflow modeling styles out of the box: procedural and flowchart. The modeling style determines how the flow of control between individual activities is modeled. The focus of this chapter is the procedural modeling style. It uses familiar programming constructs to control the flow of execution.

chapter 6: collection-related activities

This chapter focuses on the activities that enable you to work with collections of data. WF includes standard activities that iterates over each element in a collection, executing the same activity for each element. Also included in WF are a set of activities that allow you to manipulate collections, adding and removing elements and so on.

chapter 7: flowchart modeling style

The other workflow modeling style that is supported by WF is the flowchart modeling style. This style of modeling workflows enables you to use direct links between activities to control the flow of execution. In this chapter, I review the activities that are provided with WF to support this modeling style. After explaining how to model a workflow using this style, I revisit several examples that were presented in earlier chapters. This is done to contrast how the two modeling styles (procedural and flowchart) can be used to solve similar business problems.

chapter 8: host communication

This chapter focuses on direct communication between the host application and a workflow instance. The chapter provides an overview of long-running workflows and the bookmark mechanism used to implement them. The use of workflow extensions for sending data to a host application is also discussed. The classes that support a general-purpose callback mechanism are also demonstrated.

chapter 9: workflow services

This chapter focuses on the Windows Communication Foundation (WCF) support that is provided with WF. Included with this support is the ability to declaratively author WCF services using WF as well as to invoke WCF services from within a workflow.

chapter 10: workflow services advanced topics

This chapter continues coverage of the WCF support that is provided by WF. The chapter expands on this basic example from Chapter 9 by implementing additional workflow services that are consumed by the original workflow. Context-based and Content-based correlation is demonstrated, along with the duplex message exchange pattern. The chapter concludes with a discussion of exception and fault processing, flowing transactions into a workflow service, and the use of standard WF behaviors to fine-tune workflow service performance.

chapter 11: workflow persistence

An important capability of WF is the ability to persist workflow instances (save and reload them at a later time). The chapter focuses on how to enable workflow persistence in your applications. The built-in support for persistence to a SQL Server database is demonstrated in this chapter.

chapter 12: customizing workflow persistence

This chapter focuses on ways to extend or customize workflow persistence and continues the discussion that began in Chapter 11. The chapter also provides an example that implements a custom instance store that persists workflow instances to the file system rather than to a database.

chapter 13: transactions, compensation, and exception handling

This chapter focuses on the mechanisms provided by WF to support the handling of exceptions and to ensure the consistency of work that is performed within a workflow. Exception handling techniques, transactions and compensation are all demonstrated.

chapter 14: workflow tracking

Workflow tracking is a built-in mechanism that automatically instruments your workflows. By simply adding a tracking participant to the workflow runtime, you are able to track and record status and event data related to each workflow and each activity within a workflow. This chapter shows you how to use the built-in support for tracking and how to use tracking profiles to filter the type of tracking data that is produced. The chapter also demonstrates how to develop your own custom tracking participants to process the tracking data.

chapter 15: enhancing the design experience

In this chapter, you learn how to create custom activity designers. These designer components provide the visible representation of an activity on the workflow designer canvas. The chapter also demonstrates several ways to implement validation logic for activities.

chapter 16: advanced custom activities

This chapter focuses on several advanced custom activity scenarios. Most of these scenarios are related to the execution of one or more children. The chapter demonstrates how to develop your own custom activities that execute one or more child activities or invoke a callback delegate. Also demonstrated are the techniques for providing the metadata that WF requires for each activity. The chapter concludes with an example that demonstrates the use of execution properties and bookmark options.

chapter 17: hosting the workflow designer

The workflow designer is not limited to use only within the Visual Studio environment. WF provides the classes necessary to host this same designer within your applications. This chapter is all about hosting this designer. After a brief overview of the major workflow designer components, you will implement a simple application that hosts the workflow designer. In subsequent sections, you will build upon the application, adding new functionality with each section.

chapter 18: wf 3.x interop and migration

This chapter focuses on strategies for dealing with existing WF 3.0 or 3.5 applications (WF 3.x). The chapter begins with an overview of the migration strategies that are available to you followed by a demonstration of the Interop activity. This activity enables you to execute some WF 3.x activities within the WF 4 runtime environment.

appendix a: glossary

This is a glossary of commonly used WF terms.

appendix b: comparing wf 3.x to wf 4

This appendix highlights major differences between the previous version of WF (3.x) and WF 4.