Pro WF: Windows Workflow in .NET 3.0

Bruce Bukovics

Pro WF: Windows Workflow in .NET 3.0 provides you with the skills you need to incorporate WF in your applications. This book gets you up to speed with Windows Workflow Foundation quickly and comprehensively

  • Published on Jun 12 2007
  • Pages 744
  • Downloaded 9
  • Type PDF
Download
    • Like
    • Love It
    • Awesome
    • Interesting
    • It's Okay
    • Thumbs Down
  • 10.5k
  • 0

Introduction:

Introduction

Windows Workflow Foundation is a ground-breaking 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 in 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.

Author Information

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 first-hand 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 currently employed at Radiant Systems, Inc., in Alpharetta, Georgia, as a lead developer and architect in the centralized development group.

What is in this book

Contents

 

About the Author

About the Technical Reviewer

Acknowledgments

Introduction

 

CHAPTER 1 - A Quick Tour of Windows Workflow Foundation

 

Why Workflow?

Workflows Are Different

Why Windows Workflow Foundation?

Your Development Environment

Hello Workflow

Creating the Workflow Project

Introducing the Workflow Designer

Using Workflow Activities

Entering Code

Hosting the Workflow Runtime

Running the Application

Passing Parameters

Declaring the Properties

Passing Values at Runtime

Making Decisions

Creating a Workflow Library

Adding Workflow Properties

Adding IfElse Activities

Adding Calculation Logic

Creating the Calculator Client

Testing and Debugging the Calculator

Summary

 

CHAPTER 2 - Foundation Overview

 

Workflow Types

Sequential Workflows

State Machine Workflows

Choosing a Workflow Type

Foundation Deliverables

Class Libraries and Framework

Runtime Engine

Runtime Services

Design Time Tools

NET 2.0 Runtime

Runtime Environment

Application Host Process

Runtime Engine

Registered Core Services

Registered Local Services

Workflow Instance

Design Time Environment

Workflow Authoring Modes

Project Templates

Workflow Designer

Activity Designer

Rule Condition Editor

RuleSet Editor

Workflow Debugger

Command-Line Workflow Compiler

Summary

 

CHAPTER 3 - Activities

 

Understanding Activities

A Dual Audience for Activities

Class Hierarchy

Exploring Standard Activities

Custom Workflow Logic

Flow Control

State Management

Event Handling

Local Service Communication

Rules

Web Services

Transactions, Compensation, and Synchronization

Exceptions and Error Handling

Standard Activities Summary

Adding Workflow Logic

Using the CodeActivity

Creating the Project

Defining the Workflow Parameters

Validating the Account

Validating the Product

Entering the Order

Running the Workflow

Evaluating the Approach

Developing Custom Activities

Why Custom Activities?

Designing for Two Audiences

Creating the Project

Implementing the Account Validation Activity

Implementing the Product Validation Activity

Implementing the Order Entry Activity

Defining the Workflow Parameters

Defining the Workflow

Running the Workflow

Evaluating the Approach

Enhancing the Design Experience

Validating the Activity

Customizing Toolbox Behavior

Customizing the Designer

Summary

 

CHAPTER 4 - Hosting the Workflow Runtime

 

Overview of Hosting

Simple Workflow Hosting

Implementing a Test Workflow

Implementing a Simple Host Application

Improved Workflow Hosting

Implementing the Workflow Instance Wrapper

Implementing the Workflow Manager Class

Hosting with the Workflow Manager

Configuring the Runtime with AppConfig

Controlling a Workflow Instance

Synchronous Workflow Execution

Summary

 

CHAPTER 5 - Flow Control

 

Condition Types

Using the IfElseActivity

Using an IfElseActivity with Code Conditions

Using an IfElseActivity with Rule Conditions

Using the WhileActivity

Implementing the Workflow

Testing the Workflow

Using the ParallelActivity

Implementing the Workflow

Testing the Workflow

Adding a DelayActivity

Using the ReplicatorActivity

Implementing the Sequence Workflow

Testing the Sequence Workflow

Implementing the Parallel Workflow

Testing the Parallel Workflow

Using ReplicatorActivity Events

Interrupting Execution

Using the ConditionedActivityGroup

Implementing the Workflow

Testing the Workflow

Using the InvokeWorkflowActivity

Using the TerminateActivity

Using the SuspendActivity

Summary

 

CHAPTER 6 - Local Services

 

Understanding Local Services

Implementing a Local Service

Using a Local Service

Implementing and Using a Local Service

Implementing the Account Class

Declaring the Service Contract

Implementing the Local Service Class

Implementing the Workflow

Testing the Workflow

Loading from Appconfig

Using a Custom Activity

Implementing a Custom Activity

Modifying the Workflow

Testing the Workflow

Using the CallExternalMethodActivity

Implementing the Workflow

Testing the Workflow

Summary

 

CHAPTER 7 - Event-Driven Activities

 

Using Event-Driven Activities

Using the HandleExternalEventActivity

Creating the Project

Implementing the Event Arguments Class

Defining the Service Interface

Implementing the Local Service

Implementing the Workflow

Implementing the Host Application

Testing the Workflow

Generating Communication Activities

Generating the Activities

Modifying the Workflow

Manually Controlling Correlation

Implementing the Event Arguments Class

Defining the Service Interface

Implementing the Local Service

Implementing the Workflow

Testing the Workflow

Using the EventHandlingScopeActivity

Defining the Service Interface

Implementing the Local Service

Implementing the Workflow

Testing the Workflow

Summary

 

CHAPTER 8 - Workflow Persistence

 

Understanding Persistence

Why Persist Workflows?

Persistence Overview

Using the SqlWorkflowPersistenceService

Preparing a Database for Persistence

Implementing the Local Service

Implementing the Workflow

Implementing the Host Application

Testing the Application

Implementing a Custom Persistence Service

Understanding the Abstract Methods

Implementing the Service

Testing the Custom Service

Summary

 

CHAPTER 9 - State Machine Workflows

 

Understanding State Machine Workflows

Why a State Machine Workflow?

State Machine Workflow Overview

Implementing a State Machine Workflow

Designing the Car State Machine

Defining the Local Service Interface

Implementing the Local Service

Implementing the Workflow

Implementing the Host Application

Testing the Application

Eliminating Duplicate Event Handlers

Refactoring the CarWorkflow

Testing the Revised Workflow

Identifying Available Events

Interrogating the Workflow Queues

Modifying the CarStateMachine Application

Testing the Application

Accessing Runtime Information

Modifying the CarStateMachine Application

Testing the Application

Summary

 

CHAPTER 10 - Transactions and Compensation

 

Understanding Transactions

The Way of Transactions

WF Support for Transactions

Using the TransactionScopeActivity

Implementing the AccountAdjustmentActivity

Implementing the AccountTransferWorkflow

Testing the Workflow

Understanding Compensation

Using Compensatable Activities

Implementing the InventoryUpdateActivity

Implementing the OrderDetailActivity

Implementing the OrderEntryWorkflow

Testing the Workflow

Participating in a Batch of Work

Using the IPendingWork Interface

Implementing the Local Service

Implementing the BatchedWorkWorkflow

Testing the Workflow

Summary

 

CHAPTER 11 - Workflow Rules

 

Understanding Workflow Rules

Parts of a Rule

Why Use Rules?

Using Rules in WF

Defining Rules

Defining RuleSets

Identifying Dependencies with Attributes

Defining Rules with a PolicyActivity

Implementing the SalesItem Class

Declaring the Rules

Testing the Workflow

Tracing Rules

Adjusting Rule Sequence

Setting the Rule Priority

Testing the Workflow

Using Methods Within Rules

Adding the Access Methods

Using the Methods in the RuleSet

Identifying Indirect Relationships

Executing a RuleSet in Code

Implementing the SellItemSerializedWorkflow

Testing the Workflow

Constructing a RuleSet in Code

Implementing the SellItemInCodeWorkflow

Testing the Workflow

Summary

 

CHAPTER 12 - Exception and Error Handling

 

Understanding Workflow Exception Handling

Reviewing Default Behavior

Implementing the ExceptionWorkflow

Testing the Workflow

Using FaultHandlerActivity

Handling ArithmeticException

Handling DivideByZeroException

Containing the Exception

Rethrowing an Exception

Compensation and Exceptions

Implementing the CompensateWorkflow

Test the Workflow

Using CancellationHandlerActivity

Implementing the CancelHandlerWorkflow

Testing the Workflow

Summary

 

CHAPTER 13 - Dynamic Workflow Updates

 

Understanding Dynamic Updates

Why Use Dynamic Updates?

Applying Dynamic Updates

Preventing Dynamic Updates

Applying Updates from the Host Application

Implementing the DynamicWorkflow

Implementing a Custom Activity

Implementing the Host Application

Testing the Workflow

Restricting Dynamic Updates

Applying Updates from Within a Workflow

Implementing the SelfUpdatingWorkflow

Implementing the Host Application

Testing the Workflow

Updating a Rule Condition

Implementing the DynamicConditionWorkflow

Implementing the Host Application

Testing the Workflow

Replacing a Rule Definition

Modifying the RuleDefinitions

Modifying the Host Application

Testing the Revised Application

Summary

 

CHAPTER 14 - Workflow Tracking

 

Understanding Workflow Tracking

Tracking Services

Tracking Event Types

Custom Tracking Profiles

Using the Tracking Data

Benefiting from Workflow Tracking

Using the SqlTrackingService

Preparing the Tracking SQL Database

Developing a Test Workflow

Developing the Host Application

Executing the Host Application

Retrieving Tracking Data

Creating User Track Points

Enhancing the TrackingExampleWorkflow

Testing the Revised Workflow

Tracking Rules Evaluation

Implementing the TrackingRulesWorkflow

Testing the Workflow

Extracting Data with a Custom Tracking Profile

Working with Tracking Profiles

Implementing the TrackingProfileHelper

Creating the Tracking Profile

Testing the Tracking Profile

Maintaining the SQL Tracking Database

Partitioning

Setting the Partition Interval

Automatic or Manual Partitioning

Accessing Partitioned Data

Detaching or Dropping a Partition

Developing a Tracking Service

Implementing a Tracking Channel

Implementing a Tracking Service

Testing the Custom Tracking Service

Summary

 

CHAPTER 15 - Web Services and ASPNET

 

Publishing a Workflow As a Web Service

Understanding the Web Service Activities

Publishing and Configuration

Developing a Web Service Workflow

Defining the Web Service Interface

Defining the MathServiceWorkflow

Publishing the Workflow

Testing the Web Service

Returning a Web Service Fault

Modifying the MathServiceWorkflow

Testing the Revised Web Service

Developing a Stateful Web Service

Defining the Web Service Interface

Implementing the MathServiceStatefulWorkflow

Publishing the New Workflow

Testing the Web Service

Invoking a Web Service from a Workflow

Implementing the InvokeWebServiceWorkflow

Testing the Workflow

Using Workflows from ASPNET

Implementing the DivideNumberWorkflow

Implementing the UseWorkflowWebsite

Testing the Web Site

Summary

 

CHAPTER 16 - Workflow Serialization and Markup

 

Understanding Workflow Authoring Modes

Code-Only Authoring Mode

Code-Separation Authoring Mode

No-Code Authoring Mode

Developing a Code-Only Workflow

Implementing the Workflow

Testing the Workflow

Reviewing the Generated Code

Developing a Code-Separation Workflow

Implementing the Workflow

Testing the Workflow

Reviewing the Markup

Developing a No-Code Workflow

Implementing the Base Workflow Class

Implementing the Custom Activity

Defining the Workflow Markup

Enhancing the WorkflowRuntimeManager

Testing the Workflow

Using Rules with a No-Code Workflow

Defining the Rule Condition

Modifying the Workflow Markup

Testing the Workflow

Serializing to Markup

Compiling a Workflow

Compiling a Workflow with Rules

Compiling from the Command Line

Deserializing Markup

Summary

 

CHAPTER 17 - Hosting the Workflow Designers

 

Understanding the Workflow Designers

Designer Namespaces

Designer Classes

Designer Services

Building a Designer Application

Creating the Designer Project

Implementing WorkflowLoader

Implementing WorkflowMenuService

Implementing WorkflowEventBindingService

Implementing EventPropertyDescriptor

Implementing WorkflowPropertyValueService

Implementing WorkflowToolboxService

Implementing WorkflowDesigner

Implementing MainForm

Implementing AssemblyReferenceForm

Implementing NewWorkflowForm

Using the Designer

Summary

 

INDEX

 

Note:

Mindcracker Network accepts no liability for providing the customer with the hard copy of the book purchased. Mindcracker is not responsible for any dispute relating to the above. All eBooks listed in this section are in "PDF" Format. Contact [email protected] for further assistant.