Pro WF: Windows Workflow in .NET 3.0 / Edition 1

Paperback (Print)
Buy New
Buy New from
Used and New from Other Sellers
Used and New from Other Sellers
from $1.99
Usually ships in 1-2 business days
(Save 96%)
Other sellers (Paperback)
  • All (29) from $1.99   
  • New (9) from $1.99   
  • Used (20) from $1.99   


Windows Workflow Foundation (WF) is a groundbreaking addition to the core of the .NET Framework that allows you to orchestrate human and system interactions as a series of workflows that can be easily mapped, analyzed, adjusted, and implemented.

As business problems become more complex, the need for a workflow-based solution has never been more evident. WF provides a simple and consistent way to model and implement complex problems. As a developer, you focus on developing the business logic for individual workflow tasks. The runtime handles the execution of those tasks after they have been composed into a workflow.

Pro WF: Windows Workflow in .NET 3.0 provides you with the skills you need to incorporate WF into your applications. This book gets you up to speed with Windows Workflow Foundation quickly and comprehensively. The practical aspects of using WF are covered in a lively tutorial style with each workflow concept illustrated in C#. This book also includes detailed coverage of how to customize your workflows and access them in a variety of ways and situations so you can maximize the advantages of this technology.

Read More Show Less

Product Details

  • ISBN-13: 9781590597781
  • Publisher: Apress
  • Publication date: 2/21/2007
  • Series: Expert's Voice In . Net Series
  • Edition description: 1st ed. 2007. Corr. 3rd printing 2007
  • Edition number: 1
  • Pages: 744
  • Product dimensions: 7.08 (w) x 9.22 (h) x 1.08 (d)

Meet the Author

Bruce Bukovics has been a working developer for over 25 years. During this time, he has designed and developed applications in such widely varying areas as banking, corporate finance, credit card processing, payroll processing, and retail automation. He has firsthand developer experience with C, C++, Delphi, VB, C#, and Java, and he rode the waves of technology as they drifted from mainframe to client/server to n-Tier, from COM to COM+, and from Web Services to .NET Remoting and beyond. He considers himself a pragmatic programmer. He doesn't stand on formality and doesn't do things just because they have always been done that way. He's willing to look at alternate or unorthodox solutions to a problem if that's what it takes. He is employed at Radiant Systems, Inc., in Alpharetta, Georgia, as a lead developer and architect in the centralized development group.
Read More Show Less

Table of Contents

About the Author     xix
About the Technical Reviewer     xxi
Acknowledgments     xxiii
Introduction     xxv
A Quick Tour of Windows Workflow Foundation     1
Why Workflow?     1
Workflows Are Different     1
Why Windows Workflow Foundation?     2
Your Development Environment     3
Hello Workflow     3
Creating the Workflow Project     4
Introducing the Workflow Designer     5
Using Workflow Activities     6
Entering Code     7
Hosting the Workflow Runtime     9
Running the Application     11
Passing Parameters     11
Declaring the Properties     11
Passing Values at Runtime     12
Making Decisions     14
Creating a Workflow Library     14
Adding Workflow Properties     15
Adding IfElse Activities     16
Adding Calculation Logic     19
Creating the Calculator Client     22
Testing and Debugging the Calculator     25
Summary     28
Foundation Overview     29
Workflow Types     29
SequentialWorkflows     29
State Machine Workflows     30
Choosing a Workflow Type     31
Foundation Deliverables     32
Class Libraries and Framework     33
Runtime Engine     34
Runtime Services     34
Design Time Tools     35
.NET 2.0 Runtime     35
Runtime Environment     35
Application Host Process     36
Runtime Engine     37
Registered Core Services     39
Registered Local Services     42
Workflow Instance     44
Design Time Environment     46
Workflow Authoring Modes     46
Project Templates     48
Workflow Designer     48
Activity Designer     54
Rule Condition Editor     55
RuleSet Editor     57
Workflow Debugger     61
Command-Line Workflow Compiler     62
Summary     62
Activities     63
Understanding Activities     63
A Dual Audience for Activities     64
Class Hierarchy     64
Exploring Standard Activities     65
Custom Workflow Logic      66
Flow Control     66
State Management     68
Event Handling     69
Local Service Communication     70
Rules     71
Web Services     71
Transactions, Compensation, and Synchronization     72
Exceptions and Error Handling     73
Standard Activities Summary     74
Adding Workflow Logic     75
Using the CodeActivity     76
Creating the Project     77
Defining the Workflow Parameters     77
Validating the Account     81
Validating the Product     82
Entering the Order     83
Running the Workflow     87
Evaluating the Approach     90
Developing Custom Activities     90
Why Custom Activities?     91
Designing for Two Audiences     91
Creating the Project     91
Implementing the Account Validation Activity     92
Implementing the Product Validation Activity     95
Implementing the Order Entry Activity     98
Defining the Workflow Parameters     101
Defining the Workflow     102
Running the Workflow     107
Evaluating the Approach     111
Enhancing the Design Experience     111
Validating the Activity     112
Customizing Toolbox Behavior     116
Customizing the Designer     120
Summary     125
Hosting the Workflow Runtime     127
Overview of Hosting     127
Simple Workflow Hosting     128
Implementing a Test Workflow     128
Implementing a Simple Host Application     131
Improved Workflow Hosting     136
Implementing the Workflow Instance Wrapper     136
Implementing the Workflow Manager Class     139
Hosting with the Workflow Manager     147
Configuring the Runtime with App.Config     153
Controlling a Workflow Instance     158
Synchronous Workflow Execution     162
Summary     165
Flow Control     167
Condition Types     167
Using the IfElseActivity     168
Using an IfElseActivity with Code Conditions     169
Using an IfElseActivity with Rule Conditions     176
Using the WhileActivity     180
Implementing the Workflow     180
Testing the Workflow     184
Using the ParallelActivity     186
Implementing the Workflow     186
Testing the Workflow     190
Adding a DelayActivity     192
Using the ReplicatorActivity     194
Implementing the Sequence Workflow     195
Testing the Sequence Workflow     199
Implementing the Parallel Workflow     200
Testing the Parallel Workflow     204
Using ReplicatorActivity Events     206
Interrupting Execution     206
Using the ConditionedActivityGroup     207
Implementing the Workflow     207
Testing the Workflow     211
Using the InvokeWorkflowActivity     213
Using the TerminateActivity     214
Using the SuspendActivity     214
Summary     215
Local Services     217
Understanding Local Services     217
Implementing a Local Service     218
Using a Local Service     219
Implementing and Using a Local Service     219
Implementing the Account Class     219
Declaring the Service Contract     220
Implementing the Local Service Class     221
Implementing the Workflow     223
Testing the Workflow     226
Loading from App.config     228
Using a Custom Activity     231
Implementing a Custom Activity     231
Modifying the Workflow     234
Testing the Workflow     235
Using the CallExternalMethodActivity     236
Implementing the Workflow     236
Testing the Workflow     238
Summary     239
Event-Driven Activities     241
Using Event-Driven Activities     241
Using the HandleExternalEventActivity     243
Creating the Project     244
Implementing the Event Arguments Class     244
Defining the Service Interface     245
Implementing the Local Service     246
Implementing the Workflow     248
Implementing the Host Application     255
Testing the Workflow     259
Generating Communication Activities     260
Generating the Activities     260
Modifying the Workflow     261
Manually Controlling Correlation     262
Implementing the Event Arguments Class     264
Defining the Service Interface     265
Implementing the Local Service     265
Implementing the Workflow     266
Testing the Workflow     269
Using the EventHandlingScopeActivity     271
Defining the Service Interface     272
Implementing the Local Service     272
Implementing the Workflow     274
Testing the Workflow     280
Summary     283
Workflow Persistence     285
Understanding Persistence     285
Why Persist Workflows?     285
Persistence Overview     286
Using the SqIWorkflowPersistenceService     288
Preparing a Database for Persistence     289
Implementing the Local Service     289
Implementing the Workflow     291
Implementing the Host Application     293
Testing the Application     304
Implementing a Custom Persistence Service     308
Understanding the Abstract Methods     308
Implementing the Service     310
Testing the Custom Service     317
Summary     319
State Machine Workflows     321
Understanding State Machine Workflows     321
Why a State Machine Workflow?     322
State Machine Workflow Overview     323
Implementing a State Machine Workflow     326
Designing the Car State Machine     326
Defining the Local Service Interface     328
Implementing the Local Service     329
Implementing the Workflow     332
Implementing the Host Application     340
Testing the Application     347
Eliminating Duplicate Event Handlers     349
Refactoring the CarWorkflow     349
Testing the Revised Workflow     350
Identifying Available Events     351
Interrogating the Workflow Queues     351
Modifying the CarStateMachine Application     351
Testing the Application     354
Accessing Runtime Information     354
Modifying the CarStateMachine Application     355
Testing the Application     356
Summary     357
Transactions and Compensation     359
Understanding Transactions     359
The Way of Transactions     360
WF Support for Transactions     360
Using the TransactionScopeActivity     362
Implementing the AccountAdjustmentActivity     365
Implementing the AccountTransferWorkflow     369
Testing the Workflow     372
Understanding Compensation     377
Using Compensatable Activities     379
Implementing the InventoryUpdateActivity     379
Implementing the OrderDetailActivity     383
Implementing the OrderEntryWorkflow     388
Testing the Workflow     395
Participating in a Batch of Work     398
Using the IPendingWork Interface     399
Implementing the Local Service     399
Implementing the BatchedWorkWorkflow     402
Testing the Workflow     403
Summary     405
Workflow Rules     407
Understanding Workflow Rules     407
Parts of a Rule     408
Why Use Rules?     408
Using Rules in WF     409
Defining Rules     409
Defining RuleSets     412
Identifying Dependencies with Attributes     414
Defining Rules with a PolicyActivity     416
Implementing the SalesItem Class     416
Declaring the Rules     417
Testing the Workflow     424
Tracing Rules     428
Adjusting Rule Sequence     431
Setting the Rule Priority     431
Testing the Workflow     432
Using Methods Within Rules     434
Adding the Access Methods     434
Using the Methods in the RuleSet     435
Identifying Indirect Relationships     436
Executing a RuleSet in Code     437
Implementing the SellItemSerializedWorkflow     437
Testing the Workflow     440
Constructing a RuleSet in Code     441
Implementing the SellitemInCodeWorkflow     441
Testing the Workflow     444
Summary     445
Exception and Error Handling     447
Understanding Workflow Exception Handling     447
Reviewing Default Behavior     450
Implementing the ExceptionWorkflow     450
Testing the Workflow     452
Using FaultHandlerActivity     454
Handling ArithmeticException     454
Handling DivideByZeroException     458
Containing the Exception     460
Rethrowing an Exception     462
Compensation and Exceptions     463
Implementing the CompensateWorkflow     464
Test the Workflow     466
Using CancellationHandlerActivity     468
Implementing the CancelHandlerWorkflow     468
Testing the Workflow      471
Summary     471
Dynamic Workflow Updates     473
Understanding Dynamic Updates     473
Why Use Dynamic Updates?     474
Applying Dynamic Updates     474
Preventing Dynamic Updates     476
Applying Updates from the Host Application     476
Implementing the DynamicWorkflow     476
Implementing a Custom Activity     478
Implementing the Host Application     480
Testing the Workflow     484
Restricting Dynamic Updates     485
Applying Updates from Within a Workflow     486
Implementing the SelfUpdatingWorkflow     486
Implementing the Host Application     490
Testing the Workflow     491
Updating a Rule Condition     492
Implementing the DynamicConditionWorkflow     492
Implementing the Host Application     494
Testing the Workflow     498
Replacing a Rule Definition     498
Modifying the RuleDefinitions     499
Modifying the Host Application     500
Testing the Revised Application     502
Summary     502
Workflow Tracking     503
Understanding Workflow Tracking      503
Tracking Services     504
Tracking Event Types     504
Custom Tracking Profiles     505
Using the Tracking Data     506
Benefiting from Workflow Tracking     506
Using the SqlTrackingService     507
Preparing the Tracking SQL Database     507
Developing a Test Workflow     508
Developing the Host Application     510
Executing the Host Application     512
Retrieving Tracking Data     513
Creating User Track Points     521
Enhancing the TrackingExampleWorkflow     522
Testing the Revised Workflow     523
Tracking Rules Evaluation     523
Implementing the TrackingRulesWorkflow     523
Testing the Workflow     525
Extracting Data with a Custom Tracking Profile     526
Working with Tracking Profiles     527
Implementing the TrackingProfileHelper     528
Creating the Tracking Profile     532
Testing the Tracking Profile     535
Maintaining the SQL Tracking Database     536
Partitioning     536
Setting the Partition Interval     536
Automatic or Manual Partitioning      536
Accessing Partitioned Data     537
Detaching or Dropping a Partition     537
Developing a Tracking Service     538
Implementing a Tracking Channel     538
Implementing a Tracking Service     540
Testing the Custom Tracking Service     544
Summary     547
Web Services and ASP.NET     549
Publishing a Workflow As a Web Service     549
Understanding the Web Service Activities     549
Publishing and Configuration     551
Developing a Web Service Workflow     552
Defining the Web Service Interface     552
Defining the MathServiceWorkflow     552
Publishing the Workflow     555
Testing the Web Service     557
Returning a Web Service Fault     560
Modifying the MathServiceWorkflow     560
Testing the Revised Web Service     562
Developing a Stateful Web Service     562
Defining the Web Service Interface     563
Implementing the MathServiceStatefulWorkflow     563
Publishing the New Workflow     567
Testing the Web Service     567
Invoking a Web Service from a Workflow     567
Implementing the InvokeWebServiceWorkflow     567
Testing the Workflow     571
Using Workflows from ASP.NET     573
Implementing the DivideNumberWorkflow     573
Implementing the UseWorkflowWebsite     574
Testing the Web Site     578
Summary     579
Workflow Serialization and Markup     581
Understanding Workflow Authoring Modes     581
Code-Only Authoring Mode     581
Code-Separation Authoring Mode     583
No-Code Authoring Mode     584
Developing a Code-Only Workflow     586
Implementing the Workflow     586
Testing the Workflow     588
Reviewing the Generated Code     590
Developing a Code-Separation Workflow     592
Implementing the Workflow     592
Testing the Workflow     592
Reviewing the Markup     592
Developing a No-Code Workflow     594
Implementing the Base Workflow Class     594
Implementing the Custom Activity     595
Defining the Workflow Markup     596
Enhancing the WorkflowRuntimeManager     597
Testing the Workflow     599
Using Rules with a No-Code Workflow      601
Defining the Rule Condition     601
Modifying the Workflow Markup     603
Testing the Workflow     603
Serializing to Markup     604
Compiling a Workflow     608
Compiling a Workflow with Rules     611
Compiling from the Command Line     614
Deserializing Markup     615
Summary     619
Hosting the Workflow Designers     621
Understanding the Workflow Designers     621
Designer Namespaces     622
Designer Classes     622
Designer Services     623
Building a Designer Application     624
Creating the Designer Project     625
Implementing WorkflowLoader     626
Implementing WorkflowMenuService     635
Implementing WorkflowEventBindingService     639
Implementing EventPropertyDescriptor     643
Implementing WorkflowPropertyValueService     648
Implementing WorkflowToolboxService     650
Implementing WorkflowDesigner     661
Implementing MainForm     668
Implementing AssemblyReferenceForm     674
Implementing NewWorkflowForm     676
Using the Designer      679
Summary     684
Index     685
Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
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 August 26, 2008

    Good solid teaching of the WF framework

    A very solid book. Easy too read. It is quite a large book but is a great reference and has nice samples to work through. WF is a must for ones resume. I recommend this book to any that wants to learn WF. Not to mention it is using the latest Microsoft products. Also the author takes you through what you need in order to get started

    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)