| Contents at a Glance | 5 |
|---|
| Contents | 6 |
|---|
| About the Author | 20 |
|---|
| About the Technical Reviewers | 21 |
|---|
| Acknowledgments | 22 |
|---|
| Introduction | 23 |
|---|
| Who Should Read This Book | 23 |
| An Overview of This Book | 24 |
| What You Need to Use This Book | 27 |
| Obtaining This Book s Source Code | 27 |
| How to Reach Me | 27 |
| A Quick Tour of Windows Workflow Foundation | 28 |
|---|
| Why Workflow? | 28 |
| Your Development Environment | 30 |
| Hello Workflow | 31 |
| Passing Parameters | 39 |
| Making Decisions | 42 |
| Summary | 55 |
| Foundation Overview | 56 |
|---|
| Workflow Types | 56 |
| Foundation Deliverables | 59 |
| Runtime Environment | 62 |
| Design-Time Environment | 73 |
| Summary | 90 |
| Activities | 91 |
|---|
| Understanding Activities | 91 |
| Exploring Standard Activities | 93 |
| Standard Activities Summary | 103 |
| Adding Workflow Logic | 104 |
| Using the CodeActivity | 105 |
| Developing Custom Activities | 119 |
| Enhancing the Design Experience | 140 |
| Summary | 154 |
| Hosting the Workflow Runtime | 155 |
|---|
| Overview of Hosting | 155 |
| Simple Workflow Hosting | 156 |
| Improved Workflow Hosting | 163 |
| Controlling a Workflow Instance | 185 |
| Synchronous Workflow Execution | 188 |
| Summary | 191 |
| Flow Control | 192 |
|---|
| Condition Types | 192 |
| Using the IfElseActivity | 193 |
| Using the WhileActivity | 205 |
| Using the ParallelActivity | 211 |
| Using the ReplicatorActivity | 219 |
| Using the ConditionedActivityGroup | 231 |
| Using the InvokeWorkflowActivity | 237 |
| Using the TerminateActivity | 238 |
| Using the SuspendActivity | 239 |
| Summary | 239 |
| Local Services | 240 |
|---|
| Understanding Local Services | 240 |
| Implementing and Using a Local Service | 242 |
| Loading from App. config | 250 |
| Using a Custom Activity | 252 |
| Using the CallExternalMethodActivity | 257 |
| Summary | 260 |
| Event-Driven Activities | 261 |
|---|
| Using Event-Driven Activities | 261 |
| Using the HandleExternalEventActivity | 263 |
| Generating Communication Activities | 280 |
| Manually Controlling Correlation | 282 |
| Using the EventHandlingScopeActivity | 291 |
| Developing Custom Event- Driven Activities | 302 |
| Summary | 320 |
| Workflow Persistence | 321 |
|---|
| Understanding Persistence | 321 |
| Using the SqlWorkflowPersistenceService | 324 |
| Implementing a Custom Persistence Service | 343 |
| Summary | 355 |
| State Machine Workflows | 356 |
|---|
| Understanding State Machine Workflows | 356 |
| Implementing a State Machine Workflow | 361 |
| Eliminating Duplicate Event Handlers | 383 |
| Identifying Available Events | 385 |
| Accessing Runtime Information | 388 |
| Summary | 391 |
| Transactions and Compensation | 392 |
|---|
| Understanding Transactions | 392 |
| Using the TransactionScopeActivity | 395 |
| Understanding Compensation | 410 |
| Using Compensatable Activities | 412 |
| Participating in a Batch of Work | 432 |
| Using the IPendingWork Interface | 432 |
| Summary | 439 |
| Workflow Rules | 440 |
|---|
| Understanding Workflow Rules | 440 |
| Using Rules in WF | 442 |
| Defining Rules with a PolicyActivity | 450 |
| Tracing Rules | 462 |
| Adjusting Rule Sequence | 464 |
| Using Methods Within Rules | 467 |
| Executing a RuleSet in Code | 470 |
| Constructing a RuleSet in Code | 473 |
| Summary | 477 |
| Exception and Error Handling | 479 |
|---|
| Understanding Workflow Exception Handling | 479 |
| Reviewing Default Behavior | 482 |
| Using FaultHandlerActivity | 486 |
| Containing the Exception | 491 |
| Rethrowing an Exception | 493 |
| <
|