Are you a startup? Get BizSpark cloud access
Got MSDN? Get up to $3,700 of cloud benefits
Don’t have MSDN? Here’s cloud access
Windows Workflow Foundation programs coordinate with a minimal ceremony. It provides a programming model, in-process workflow engine and rehostable designer to implement long-running processes as workflows within .NET applications.
In .NET Framework 4, Windows Workflow Foundation introduces a significant amount of change from the previous versions in .NET 3.0 and 3.5. In fact, the team revisited the core of the programming model, runtime and tooling and has re-architected each one to increase performance and productivity. And they addressed important feedback garnered from customer engagements using the previous versions.
It’s useful to think about different kinds of applications that might use workflows
For ISVs, Workflows can help you provide the ability for users to customize what your application does without a major intrusion into your functionality. You can empower your users:
In the .NET Framework 4, there have been significant enhancements in the Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) frameworks. .NET developers can use these technologies, either independently or together, to eliminate the tradeoff between ease of service authoring and performant, scalable services.
Workflow in .NET is comprised of Activities, Runtime, Tooling. Here’s a summary of the important changes to .NET 4 Workflows.
A declarative workflow can be made within a XAML file with no code-behind. This means that workflows can be stored, retrieved, and altered as data.
As developers, we need the same power and flexibility of a declarative programming model for the internals of an application as we have for the user interface in Windows Presentation Foundation (WPF). Windows Workflow Foundation (WF) provides the declarative framework for building application and service logic and gives developers a higher level language for handling asynchronous, parallel tasks and other complex processing.
In .NET 4 you get new activities:
WF 4.0 makes it much easier to:
Activity is the core base type in the programming model and represents both workflows and activities. In addition, you no longer need to create a WorkflowRuntime to invoke a workflow. You can simply create an instance and execute it, simplifying unit testing and application scenarios where you do not want to go through the trouble of setting up a specific environment.
The workflow programming model becomes a fully declarative composition of activities, with no code-beside, simplifying workflow authoring.
Flowing data across activities is challenging. It requires dependency properties and data binding. It feels unnatural to most developers.
In addition, managing activity state is also challenging; there was no way to define local storage in XAML
WF 4.0 simplifies data flow by adding arguments, variables, and expressions.
Major improvements to WCF integration
New messaging activities, message correlation, and improved hosting support, along with fully declarative service definition are the major areas of improvement.
You can think "WCF on the outside, WF on the inside". WCF exposes external interface while WF describes internal flow & state transitions.
When sending and receiving WCF messages, correlation is a common need. In .NET 3.5 correlates based on context headers, while .NET 4.0 adds correlation support to WCF. WF makes correlation easy to use via activities
The designer now supports the ability to work with much larger workflows without a degradation in performance and designers are all based on Windows Presentation Foundation (WPF), taking full advantage of the rich user experience one can build with the declarative UI framework. Activity developers will use XAML to define the way their activities look and interact with users in a visual design environment. In addition, rehosting the workflow designer in your own applications to enable non-developers to view and interact with your workflows is now much easier.
AppFabric, formerly known as Code Name "Dublin", provides WF hosting & management extensions to IIS and WAS.
Windows Server AppFabric has three core capabilities: caching, workflow management and service management.
For Web applications, Windows Server AppFabric provides caching capabilities to provide high-speed access, scale, and high availability to application data thereby avoiding unnecessary calls to the data source.
For composite applications, Windows Server AppFabric makes it easier to build and manage services built using Windows Workflow Foundation and Windows Communication Foundation.
In general, customers who have applications composed of services, web, data, and legacy components will find that Windows Server AppFabric makes it simpler to develop, deploy, and manage these composite applications.
For more information and to try out AppFabric, see Windows Server AppFabric.
Flowcharts offer a middle ground between the sequential and state machine models. You get:
The Flowchart more closely resembles the concepts and thought processes that many analysts and developers go through when creating solutions or designing business processes. Therefore, it made sense to provide an activity to make it easy to model the conceptual thinking and planning that had already been done. The Flowchart enables concepts such as returning to previous steps and splitting logic based on a single condition, or a Switch / Case logic.
.NET 4.0 re-factors the programming model for creating custom activities. Derive your custom activity from WorkflowElement to creating custom activities from scratch. Derive from Activity to create custom activities from other Activities.
In First Look at .NET 4 Workflow -- Part 2, I’ll walk you through the concepts of a basic workflow. You can try out a hands on lab using the Visual Studio 2010 and .NET Framework 4 Training Kit.
Your 3.x workflows will continue to work using the WF 3.0 runtime. And you can use 3.x activities in a 4.0 workflow using use the .NET 4 Interop activity. Guidance will be coming soon for how to prepare your 3.x applications.
For an overview of how workflows can integrate into your application, see Business Process & Workflow video from MSDEV.
I recommend you try out the hands on lab that’s part of the Visual Studio 2010 and .NET Framework 4 Training Kit.
In the lab you will get to know the basics of creating, hosting and running a workflow. This lab is also intended to be an introduction to the new workflow authoring constructs in the .NET Framework 4 and Visual Studio 2010, including the new Workflow Designer, expressions, variables and arguments. Additionally, you will explore the use of some basic built-in activities.
In this Hands-On Lab, you will learn:
Bruce D. Kyle ISV Architect Evangelist | Microsoft Corporation
Special thanks to Ron Jacobs, Senior Technical Evangelist
Microsoft removed .NET 3.5 Workflow from .NET Services, but you don't mention how .NET 4.0 fits into the Azure AppFabric picture.
What's the story for .NET 4 Workflow in Azure Web and Worker roles?
--rj
Workflow in .NET 4 is baked into AppFabric. AppFabric makes it easier to build and manage services built using Windows Workflow Foundation (WF) and Windows Communication Foundation (WCF). These capabilities are based on the technology previously code named “Dublin.”
For more details, see http://blogs.msdn.com/endpoint/archive/2009/11/17/developing-and-managing-services-with-windows-server-appfabric.aspx
You can also get more information on the forum AppFabric Service and Workflow Management at http://social.msdn.microsoft.com/Forums/en-US/dublin/threads