You are previewing Programming Windows Workflow Foundation: Practical WF Techniques and Examples using XAML and C#.
O'Reilly logo
Programming Windows Workflow Foundation: Practical WF Techniques and Examples using XAML and C#

Book Description

"

A C# developer's book and eBook guide to the features and programming interfaces of Windows Workflow Foundation

  • Add event-driven workflow capabilities to your .NET applications.

  • Highlights the libraries, services and internals programmers need to know

  • Builds a practical "bug reporting" workflow solution example app

In Detail

Windows Workflow Foundation (WF) is a technology for defining, executing, and managing workflows. It is part of the .NET Framework 3.0 and will be available natively in the Windows Vista operating system.

Windows Workflow Foundation might be the most significant piece of middleware to arrive on the Windows platform since COM+ and the Distributed Transaction Coordinator. The difference is, not every application needs a distributed transaction, but nearly every application does have a workflow encoded inside it.

In this book, K Scott Allen, author of renowned .NET articles at www.odetocode.com, provides you with all the information needed to develop successful products with Windows Workflow.

From the basics of how Windows Workflow can solve the difficult problems inherent in workflow solutions, through authoring workflows in code, learning about the base activity library in Windows Workflow and the different types of workflow provided, and on to building event-driven workflows using state machines, workflow communications, and finally rules and conditions in Windows Workflow, this book will give you the in-depth information you need. Throughout the book, an example "bug reporting" workflow system is developed, showcasing the technology and techniques used.

A fast-paced and practical developer's road map to working with Windows WF, from compilation to the base activity library to runtime services.

"

Table of Contents

  1. Programming Windows Workflow Foundation: Practical WF Techniques and Examples using XAML and C#
    1. Programming Windows Workflow Foundation: Practical WF Techniques and Examples using XAML and C#
    2. Credits
    3. About the Author
    4. About the Reviewer
    5. Preface
      1. What This Book Covers
      2. What You Need for This Book
      3. Conventions
      4. Reader Feedback
      5. Customer Support
        1. Downloading the Example Code for the Book
        2. Errata
        3. Questions
    6. 1. Hello, Workflow
      1. Building Workflow Solutions
      2. A Windows Workflow Tour
        1. Activities
          1. Custom Activities
        2. Visual Studio 2005 Extensions
          1. Windows Workflow and XAML
          2. WF Validation and Debugging
          3. Designer Looks
        3. The Windows Workflow Runtime
          1. Hosting the Windows Workflow Runtime
          2. Runtime Services
            1. Scheduling Services
            2. Transaction Services
            3. Persistence Services
            4. Tracking Services
      3. Our First Workflow
      4. Summary
    7. 2. Authoring Workflows
      1. Pure Code
        1. Pure Code and Visual Studio
      2. Objects and Their Relationships
      3. Pure XAML
        1. Using Custom Activities in XAML
        2. Compiling Workflows
          1. Compiling with Wfc.exe
          2. Compiling with WorkflowCompiler
          3. Compilation with MSBuild
          4. Code Generation and XAML Serialization
        3. XAML Activation
        4. XAML-only Summary
      4. Code and XAML Together
      5. Summary
    8. 3. Sequential Workflows
      1. The SequenceActivity
        1. Simple Flow
          1. Sequences Inside Sequences
      2. Workflows and the Outside World
        1. Workflow Instance Lifetime Events
        2. Workflow Parameters
        3. Raising Events and Invoking Methods
          1. Service Contracts
          2. Service Implementation
          3. Workflow Implementation
          4. Host Implementation
      3. Faults
      4. Summary
    9. 4. The Base Activity Library
      1. The Basics
        1. The CodeActivity
        2. The IfElseActivity
        3. The WhileActivity
        4. The SequenceActivity
        5. The SuspendActivity
        6. The TerminateActivity
        7. The ThrowActivity
        8. The InvokeWorkflowActivity
        9. The ParallelActivity
        10. The DelayActivity
        11. The ListenActivity
        12. The EventHandlingScopeActivity
        13. The SynchronizationScopeActivity
        14. The ReplicatorActivity
      2. Local Communication Events
        1. The CallExternalMethodActivity
        2. The HandleExternalEventActivity
        3. The Activity Generator
      3. Fault Handling
        1. The FaultHandlersActivity
        2. The FaultHandlerActivity
      4. Transactions and Compensation
        1. The TransactionScopeActivity
        2. Compensation
        3. The CompensatableSequenceActivity
        4. The CompensatableTransactionScopeActivity
        5. The CompensateActivity
      5. Conditions and Rules
        1. The ConditionedActivityGroup
        2. The PolicyActivity
      6. Web Services
        1. The InvokeWebServiceActivity
        2. The WebServiceInputActivity
        3. The WebServiceOutputActivity
        4. The WebServiceFaultActivity
      7. State Activities
        1. The StateActivity
        2. The StateInitializationActivity
        3. The StateFinalizationActivity
        4. The EventDrivenActivity
        5. The SetStateActivity
      8. Summary
    10. 5. Custom Activities
      1. Why Would I Build Custom Activities?
        1. Reusability
        2. Extensibility
        3. Domain-Specific Languages
      2. How Do I Build Custom Activities?
      3. Activity Composition
        1. Opening a Black Box
          1. Property Promotion
        2. Composition Summary
      4. Dependency Properties
        1. Activity Binding
        2. Attached Properties
        3. Meta-Properties
        4. Dependency Property Summary
      5. Derivation
        1. ConsoleWriteActivity
        2. Activity Components
          1. Activity Validators
          2. Activity Designers
      6. Activity Execution
        1. Execution Context
        2. Custom Composite Activities
      7. Summary
    11. 6. Workflow Hosting
      1. The Workflow Runtime
        1. Workflow Runtime Logging
        2. Workflow Runtime Configuration
          1. Workflow Configuration Sections
      2. Scheduling Services
        1. Scheduling Services and Threads
        2. Scheduling Services and Configuration
          1. Scheduling Parameters
        3. Choosing the Right Scheduling Service
      3. Persistence Services
        1. Persistence Classes
        2. The SqlWorkflowPersistenceService
          1. SQL Persistence Service Configuration
          2. Running with Persistence
          3. Persistence and Serialization
      4. Tracking Services
        1. Tracking Classes
        2. Tracking Configuration
        3. Running with Tracking
          1. Tracking Profiles
        4. Data Maintenance
      5. Persistence and Tracking Together
        1. Shared Connection Configuration
      6. Summary
    12. 7. Event-Driven Workflows
      1. What Is a State Machine?
      2. State Machines in Windows Workflow
      3. Our First State Machine
        1. Creating the Project
        2. Life of a Bug
        3. The State Activity
          1. The EventDriven Activity
          2. The SetState Activity
          3. The StateInitialization and StateFinalization Activities
        4. Driving the State Machine
      4. Inspecting State Machines
        1. StateMachineWorkflowInstance
        2. State Machine Tracking
      5. Hierarchical State Machines
      6. Summary
    13. 8. Communication in Workflows
      1. Local Communication Services Redux
        1. Correlation Parameters
          1. Correlation Attributes
            1. Correlation Parameter
            2. Correlation Initializer
            3. Correlation Alias
          2. Correlation Tokens
        2. Role‑Based Authorization
          1. Roles and Activities
        3. Workflow Queues
          1. WorkflowQueue and WorkflowQueueInfo
          2. Finding the Waiting Activity
          3. Canceling a Waiting Activity
          4. Communicating with Queues
      2. Web Service Communication
        1. Workflows as Web Services
          1. WebServiceInput Activity
          2. WebServiceOutput Activity
          3. Publishing Web Service Workflows
        2. Workflows as Web Service Clients
          1. InvokeWebService Activity
      3. Summary
    14. 9. Rules and Conditions
      1. What are Rules and Conditions?
      2. Working with Conditions
        1. Code Conditions
        2. Rule Conditions
          1. The .rules File
          2. Available Expressions
          3. Rules and Activation
        3. The Conditioned Activity Group
          1. When to Use the CAG
      3. Working with Rules
        1. The Policy Activity
          1. Creating a Policy Workflow
          2. Evaluation
          3. Priority
          4. Rule Dependencies
            1. Implicit Chaining
            2. Chaining with Attributes
            3. Explicit Chaining
          5. Controlling Chaining
            1. Chaining Behavior
            2. Re-evaluation Behavior
        2. Rules Engine Tracing and Tracking
          1. Tracing Rules
          2. Tracking Rules
        3. Dynamic Updates
      4. Summary