![Programming Windows Workflow Foundation: Practical WF Techniques and Examples using XAML and C#](https://wfqqreader-1252317822.image.myqcloud.com/cover/46/34853046/b_34853046.jpg)
What This Book Covers
Chapter 1 introduces us to the concept of workflow and describes how Windows Workflow can solve the difficult problems inherent in workflow solutions. We'll become familiar with activities as the basic building blocks of a workflow definition and demonstrate how to author a simple workflow using Visual Studio 2005. This chapter also describes the runtime services available with WF. By the end of the chapter we will be able to identify the primary features of Windows Workflow.
Chapter 2 concentrates on authoring workflows. Specifically, we'll look at how to build workflows with C#, and with extensible application markup language (XAML). Looking at the workflow compiler, we'll have a better understanding of how WF uses code generation to produce classes from workflow markup, and how this generated code can combine with our hand‑written code to produce a workflow type. This chapter will provide the fundamental knowledge needed to understand how WF operates during the compilation phase.
In Chapter 3, we will turn our attention to sequential workflows. We will examine the SequenceActivity
and learn about the events fired by the workflow runtime during the life of a workflow instance. Using Visual Studio, we will build workflows that accept parameters and communicate with a host process by invoking methods and listening for events. The chapter concludes with a workflow example that raises an exception and uses a fault handler.
Chapter 4 examines each activity in the WF base activity library. We will look at the control flow activities, communication activities, and transaction-oriented activities. The chapter also examines web service activities, rule-centric activities, and state activities. The goal of this chapter is to make us aware of all the capabilities provided by the base activity library, with an eye towards understanding how each activity can solve a particular problem.
With an understanding of what is available in the base activity library, we can look at building our own custom activities in Chapter 5. This chapter examines the motivations for building custom activities, and provides examples of building a custom activity using both a compositional approach and a derivation approach. We'll see how to build a custom validator and designer for our activity, and also understand the advantages of using dependency properties. The chapter ends by covering the execution context, which we must understand to build robust activities.
Chapter 6 covers the workflow runtime, workflow diagnostics, and the out‑of‑the‑box services provided for WF by Microsoft. The chapter demonstrates how to configure services both declaratively and programmatically. We'll see examples of how to use a scheduling service, persistence service, and tracking service. The chapter provides enough information to allow a developer to select and configure the services needed for a wide variety of scenarios and environments.
Chapter 7 focuses on building event‑driven workflows using state machines. We'll see how WF models the traditional state machine using activities, and we will build a workflow to handle external events and react with state transitions. We'll also see how to track and examine the history of state machine execution. The chapter ends with an examination of a hierarchical state machine, which provides all the knowledge we need to tackle tough problems with event‑driven workflows.
Chapter 8 is dedicated to workflow communications. The chapter explains how to use correlated local services for communication with a host process, and web service activities for communication across a network. By the end of the chapter we'll uncover the queuing service that is used behind the scenes of a workflow to coordinate and deliver messages.
Finally, Chapter 9 is about rules and conditions in Windows Workflow. This discusses the role of business rules in software development and provides examples of how WF's rules engine can take away some of the burden of rule development. The chapter takes an in-depth look at rule execution in the PolicyActivity
, and recording diagnostic information about rule evaluation. We'll come away with the knowledge we need to build rule‑based solutions using Windows Workflow.