Essential Windows Workflow Foundation [NOOK Book]


In Essential Windows Workflow Foundation, two WF lead architects–Dharma Shukla and Bob Schmidt–offer an under-the-hood look at the technology, explaining the why and not just the how of WF’s key concepts and architecture. Serious WF developers seeking details about how to effectively utilize and extend the framework by writing activities will find cogent explanations and answers here. With simple and illustrative examples, the authors demonstrate exactly how to leverage WF’s extensible programming model to craft ...

See more details below
Essential Windows Workflow Foundation

Available on NOOK devices and apps  
  • NOOK Devices
  • NOOK HD/HD+ Tablet
  • NOOK
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK Study

Want a NOOK? Explore Now

NOOK Book (eBook)
$22.99 price
(Save 42%)$39.99 List Price


In Essential Windows Workflow Foundation, two WF lead architects–Dharma Shukla and Bob Schmidt–offer an under-the-hood look at the technology, explaining the why and not just the how of WF’s key concepts and architecture. Serious WF developers seeking details about how to effectively utilize and extend the framework by writing activities will find cogent explanations and answers here. With simple and illustrative examples, the authors demonstrate exactly how to leverage WF’s extensible programming model to craft domain-specific programs. Drawing on their unique vantage point in designing and developing WF, Shukla and Schmidt deliver authoritative coverage of

  • The core concepts and ideas that form the heart of WF’s programming model

  • The execution model for activities, with details of the activity automaton, bookmarking, scheduling, and the threading model of the WF runtime

  • Advanced execution concepts, including activity execution contexts, transactions, persistence points, passivation, fault handling, cancellation, compensation, and synchronization

  • Hosting the WF runtime in applications

  • The activity component model, with details of validation, compilation, serialization, and visualization

  • Databinding, XAML, dependency properties, and WF program metadata

  • Declarative conditions and rules, activity designers, and designer hosting

  • Custom control flow patterns ranging from simple sequencing and iteration to more complex graphs and state machines

  • Dynamic editing of running WF program instances

Essential Windows Workflow Foundation is the definitive resource for developers seeking an in-depth understanding of this novel technology.

Read More Show Less

Editorial Reviews

From Barnes & Noble
The Barnes & Noble Review
Increasingly, developers want to build business process-driven software using workflows. Conventional software development approaches weren't really designed for this. Windows Workflow Foundation (WF), introduced with Vista and .NET 3.0, is. Built around "activities," it's a whole new paradigm. That means a lot to learn. Start with this book.

Essential Windows Workflow Foundation teaches the principles of "activity-oriented, reactive" WF programming: principles you should understand before you use the new types in .NET 3.0's System.Workflow namespace. The authors, key contributors to Microsoft's WF development team, illuminate many possibly unfamiliar programming concepts: bookmarks, continuations, and resumable program statements, to name a few.

You'll learn how to build activities, and how they execute; how to write and extend applications that host the WF runtime; how to use advanced capabilities such as validation and compilation. There are plenty of examples, too, helping make these powerful ideas very real. Bill Camarda, from the December 2006 Read Only

Read More Show Less

Product Details

  • ISBN-13: 9780132797535
  • Publisher: Pearson Education
  • Publication date: 10/19/2006
  • Sold by: Barnes & Noble
  • Format: eBook
  • Edition number: 1
  • Pages: 480
  • File size: 3 MB

Meet the Author

Dharma Shukla is an architect at Microsoft working on next-generation programming models. A founding member of the Windows Workflow Foundation (WF) team, Dharma played a key role in defining the architecture of WF. Bob Schmidt is a senior program manager at Microsoft working on next-generation programming models. Since 2003, his primary focus has been on the design of WF. Both authors have been involved with the WF project since its inception, and have been responsible for specifying, designing, and developing large portions of the technology.

Read More Show Less

Table of Contents

About the Authors xiii

Foreword xv

Preface xvii

Acknowledgments xxi

1 Deconstructing WF 1

2 WF Programs 33

3 Activity Execution 53

4 Advanced Activity Execution 111

5 Applications 179

6 Transactions 241

7 Advanced Authoring 259

8 Miscellanea 325

Appendix A Activity Automaton 395

Appendix B Control Flow Patterns 397

Index 435

Read More Show Less



As I write this foreword in July 2006, I know something big is about to happen.

Developers are discovering the power of having machine-readable representations of their programs that match their intention. This idea is sometimes referred to using the shorthand phrase code as data.

More importantly, developers are realizing that no runtime architect or language designer is all that qualified to define the schema for that data—a domain expert is the only one who has the right expertise. This idea is sometimes referred to as domain-specific languages.

Systems like Smalltalk, the Java Virtual Machine (JVM), and the Common Language Runtime (CLR) have proven that there is value in having machine-readable representations of type definitions for things such as reflection, serialization, and generative programming. However, the basic representation of a type (e.g., fields, methods, classes) is largely a closed world, which doesn't allow users to model (as data) things such as control flow, concurrency, logic constructs, or domain-specific ideas such as discount policy or dotted whole note except as largely opaque instructions strewn across multiple method bodies.

People are now asking themselves, "If my type definition is available as data, why aren't other design-time constructs as well?"

Fortunately, one of the people asking those questions back in 2003 was my good friend Dharma Shukla, who was then working on the Biztalk Server team.

When the Biztalkers set out to generalize their XLANG orchestration engine as an embeddable platform component, they could have simply taken the language constructs from XLANG and put yet another XML syntax around them (that proposal was certainly on the table). This is the most obvious approach and would have satisfied their charter for building the Windows Orchestration Engine (WinOE) perfectly well.

Fortunately, Dharma had the foresight to know that he wasn't the right guy to define "the one true schema" for all programs and instead decided to "go meta" and steer the project toward building an extensible runtime that allows users to define their own opcodes that match the domain they're working in. Add to this the decision to support defining and composing these opcodes in an XML dialect and you have a system that lets anyone decide what the vocabulary and sentence structure is for describing applications in a given domain.

As Dharma Shukla and Bob Schmidt so aptly show with this book, Windows Workflow Foundation (WF) is an excellent example of a meta-runtime that puts developers in control of how programs are written and how programs execute. The developer defines the schema for a program and then provides an interpretation over that schema to allow it to be deployed and run. It is a simple idea that has huge ramifications.

Like I said, something big is about to happen.

Don Box July 2006, Yarrow Point, WA


Windows Workflow Foundation (WF) is a general-purpose programming framework for creating reactive programs that act in response to stimulus from external entities. The basic characteristic of reactive programs is that they pause during their execution, for unknown amounts of time, awaiting input.

Reactive programs are, of course, not a new phenomenon. Ever since computers have been organized into networks, it has been useful for programs on one machine to communicate with programs on other machines. Techniques for exchanging data are also applicable to programs running on a single computer. A variety of technologies ranging from sockets to web services has been used over the years to get programs to communicate. Although the interoperability, scalability, and approachability of the programming models at hand have improved greatly over the years, relatively scant attention has been paid to the manner in which developers put reactive programs together. For example, popular web programming models put the burden of enforcing appropriate control flow among operations squarely on the developer. WF attempts to change this.

The focal point of the WF programming model is the concept of an activity—a program statement in a WF program. An activity's execution is inherently resumable and unfolds in an episodic manner, pausing and resuming according to the activity's interactions with external entities. Just as you can stick a bookmark in a page of this book when you are finished reading for the night, it is natural for an activity to bookmark its execution (when it is awaiting input) and then continue right where it left off at a later time (when the relevant input arrives).

WF is a framework, not a fixed set of programming constructs defined by a language grammar. WF's notion of an activity is extensible, which allows the expressiveness and control flow in WF programs to be richer than what is provided by a language like C# or Visual Basic. You can represent WF programs using domain-specific activities and specialized control flow constructs, and thereby capture complex interactions among people and software with a high degree of fidelity to the particulars of the problem being solved.

The WF runtime is a meta-runtime that builds upon the Common Language Runtime (CLR) and manages the execution of WF programs. WF programs naturally pause and resume, and can execute over arbitrarily long periods of time within a distributed (multi-machine) execution environment without any extra work on the part of the programmer. A WF program will neither fail nor cause undue strain on system resources if it sits idle for weeks. The CLR's job, in the context of WF, is to manage objects that transiently represent WF programs while they are in memory. The WF runtime's job is to manage the full lifecycle of WF programs, which can span CLR threads and application domains, operating system processes, and even machines.

In sum, WF provides a programming model for writing and executing reactive programs. WF programs are constructed using domain-specific program statements called activities, which allow domain experts to express their programming intent in the parlance of their domain.

About the Book

There is a simple reason why this book was written. Both of us believe there is a novel synthesis of noteworthy ideas at the heart of WF. These ideas are seeing the light of day for the first time in a mainstream platform. Because WF's activity-oriented programming approach rests on a different set of principles than do today's popular programming paradigms, the best way to learn WF is to focus first on the fundamental ideas around which the WF programming model is built. There is more to becoming an effective WF developer than just familiarizing yourself with the types that reside in the new System.Workflow namespace of the .NET Framework.

To that end, this book does not aim to exhaustively discuss the 350+ types present in the three assemblies that constitute WF. We deliberately disregard some outer layers of WF so as to focus on the essence—the core programming model and runtime feature set. Experience has taught us that learning the capabilities of the framework from first principles is the surest way to becoming a proficient WF developer.

The writing of this book has led us to examine and debate our beliefs and assumptions about the nature of reactive programs and how such programs can be developed. If this book, and WF, provides someone with a fresh idea upon which to build further, we will consider our efforts a success.

The organization of this book is as follows. Chapter 1, "Deconstructing WF," examines the key ideas that underpin the WF programming model: bookmarks, continuations, thread and process agility, passivation, resumable program statements, and a runtime for resumable programs. These ideas are discussed in their barest form, outside the context of WF, to maximize the clarity of the discussions.

Chapter 2, "WF Programs," maps the concepts introduced in the first chapter onto the richer programming surface of WF, and therefore acts as a bridge to the rest of the book. Here we begin developing activities, composing them into simple WF programs, and running those programs.

Chapters 3, "Activity Execution," and 4, "Advanced Activity Execution," discuss detailed aspects of how activities execute including bookmarking, fault handling, cancellation, and compensation. The unifying theme is the activity automaton that describes the lifecycle of all activities. Chapter 5, "Applications," explores how to build applications that host the WF runtime and leverage its points of extensibility. Chapter 6, "Transactions," discusses the critical role of transactions in the execution of WF programs. Chapter 7, "Advanced Authoring," covers a number of advanced topics related to activity and WF program authoring, including validation and compilation, and Chapter 8, "Miscellanea," introduces several feature areas of WF that are built around the previously discussed core concepts.

Appendix A, "Activity Automaton," is a reference for the activity automaton. Appendix B, "Control Flow Patterns," presents the code for several composite activities that are more complex than those developed in the main text. These examples highlight extensibility points of the WF programming model, and demonstrate the capability of composite activities to capture complex control flow patterns.

Our focus in this book is exclusively on Windows Workflow Foundation. We assume prior understanding of C# 2.0 and the basics of the CLR; see The C# Programming Language, Second Edition by Anders Hejlsberg, et al. (Addison-Wesley, ISBN: 0321334434) and Essential .NET, Volume I: The Common Language Runtime by Don Box and Chris Sells (Addison-Wesley, ISBN: 0201734117) for definitive discussion of these subjects. Examples we present in this book are simple—purposefully stripped of scenario noise—so as to minimize distractions from the concepts being discussed. After you learn the ropes, we expect you'll try applying the ideas and techniques explained here to the domain of your choosing.

© Copyright Pearson Education. All rights reserved.

Read More Show Less

Customer Reviews

Average Rating 5
( 1 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing 1 Customer Reviews
  • Anonymous

    Posted November 2, 2006

    takes scheduling of programs to another level

    WWF encapsulates some intriguing abilities that were hitherto not available in C#/.NET, or in the competing Java environment. Or at least not easily available. In both areas, there has already been the concept of serialisation. Where you can write code from memory to disk in a manner such that the code's classes can be read back as functioning binaries, at some later time. Both also have transactions and threads. WWF takes those ideas and merges them. The authors show how this results in the concept of a resumable program. The core idea in WWF. So a runtime program can be passivated (the equivalent of the earlier serialisation idea), and given a globally unique id. Then, a special Runtime program can de-passivate the program and run it, at some future time. In essence, it gets around the conundrum that when a conventional program, in any language, ends, then it ends. You needed to write custom code in another program, that could invoke the first, in some fashion. Very clumsy and error prone. WWF provides a declarative and robust way to transcend the ending of a program. Takes scheduling to the next level. Plus, the book shows that the de-passivating of a resumable program can be done on another machine, that has access to the medium in which the program was passivated. (This was the point of using a globally unique id for the passivated program.) Obvious implications for load balancing and robustness design.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing 1 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)