Basic Introduction to Windows Workflow Foundation


The .Net 3.0 RTM version was released earlier this week.  .Net 3.0 consists of the following main components:

 

  • .Net Framework
  • Microsoft Windows Communication Foundation
  • Microsoft Windows Presentation Foundation
  • Microsoft Windows Workflow Foundation 

In this article we will go through the basic concepts of Windows Workflow Foundation.

 

The Windows Workflow foundation provides a platform built on the .Net Framework for building workflows. It is not an application or a server product, and is included as a component of the .Net 3.0 framework. The platform unleashes the power of a completely different paradigm.

 

Some of the major criteria for workflows are listed below:

 

  1. Visual Representation of process(es)
  2. Can be dynamically modified at run-time
  3. Can be long-running 

There are two major types of workflows -

  • Sequential workflows: used for well-defined, process workflows
  • State Machine workflows: Organized as state machine diagrams, typically used for workflows with human interaction. 

Workflows can either be built declaratively by using only Markup, or only Code or a combination of both Markup and code.

 

Once the workflow is developed, it can be hosted on any application that can load the Workflow Runtime such as Windows Forms, Windows Services, ASP.Net Web Sites and Web Services.

 

Activities: Workflows consist of one or more activities. Activities are the building blocks of workflows. A set of pre-built activities is provided for developers. You can also build your own custom activities.

 

Services: The workflow runtime engine uses many services when executing a workflow instance. You can either use the services in the Windows Workflow Foundation, or you can customize the available services, or you can build your own services.

 

Long Running Workflow: Workflows in real life can have a long and unpredictable execution life. The Windows Workflow Foundation handles this capability and can persist workflows, as required.

 

Compensation: Transactions in the workflow world are different compared to traditional transactions. In cases where we have long running workflows, it may not be possible to exactly "rollback" a set of steps when an exception occurs. Instead, the workflow allows "compensation" which in simple terms is the action taken to cover up for the effect of the part of the transaction that has already been completed.

 

Tracking: The visual nature of a workflow definition leads us to the next requirement, which is - tracking the progress of a running workflow. Windows Workflow Foundation provides the Tracking services to track the status of workflow instances.

 

Rules and Conditions: You can apply logical conditions in 2 ways in workflows

 

  1. Specify Code Conditions: programmatically define whether certain paths of the workflow are run. This is similar to specifying a condition in an If Statement, in traditional programming.
  2. Rules: programmatically or declaratively define the business rules for workflows.

    Rules allow complex forward chaining rule sets and lend towards easy modification at runtime. Rules also enable the separation of Business logic and Process flow and can be shared across workflows         

Windows Workflow Foundation vs BizTalk Server

One of the most common questions for those new to Workflows is, how does this technology differentiate from BizTalk Server.

 

Windows Workflow Foundation is a platform for developing workflows within applications.

BizTalk Server is a server product targeted for business process automation.

 

Microsoft Office 2007:

This technology is also extended into areas of Microsoft Office 2007, notably, providing workflow support in Sharepoint 2007.

 

Resources:

The .Net 3.0 Framework RTM and Vistual Studio 2005 extensions for .Net Framework 3.0 are available for download as follows:

Conclusion

 

In this article, we took a look at the introductory concepts of Windows Workflows Foundation. With all the new releases, it is definitely a very exciting time to be a developer. 

Disclaimer:

This article is for purely educational purposes and is a compilation of notes, material and my understanding on this subject. Any resemblance to other material is an un-intentional coincidence and should not be misconstrued as malicious, slanderous, or any anything else hereof.  

X

Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now