Windows Workflow Foundation
It’s been a long time coming! We announced Windows Workflow Foundation at the PDC today which means we can finally talk about it! J
For those of you familiar with BizTalk Server 2004, Windows Workflow Foundation is analogous to the Orchestration Designer and Orchestration Runtime (XLANG) in BizTalk. It allows you express your “workflow” using a designer and then have this executed by a runtime.
The Orchestration designer in BizTalk was fairly heavy-weight and not really suitable to be hosted and used in other applications (memory footprint, etc.), Windows Workflow Foundation is light-weight and re-hostable allowing you to integrate workflow functionality into your application.
Windows Workflow will ship with WinFX, and will be supported on Windows Vista, Windows Server 2003 and Windows XP which is fantastic news as you won’t have to wait for Windows Vista to be prevalent - and it's in the platform (no product to buy apart from the OS).
A key point is that you can host Windows Workflow in any host (ASP.NET, WinForms, Console App….), and you can completely re-skin the designer tool and even host the designer in your own app if you don’t want to design workflow inside Visual Studio which is the default.
BizTalk Orchestration let you define “sequential workflow” in that it would always follow a pre-determined path, you can do this in Windows Workflow but you can also define State Machine Workflows which are more suited to workflow involving manual human steps.
The “shapes” on the workflow are called Activities, and you can write you own extremely easily – again these are analogous to the toolbox items on the Orchestration Designer. So if you want to send an email from a workflow then you could write a custom activity that uses the .NET Framework to send a mail and then use this activity from any number of workflows.
The debugging story is fantastic, you can step into workflows and debug through activities and even drill into your activity code all inside Visual Studio. Workflow can be customised using code-behind files in the same way as ASP.NET – if you double click on a “shape” it brings up the workflow code file, anyone who's done lots of BizTalk development will seriously appreciate this type of control.
Business Rules are built into the designer allowing you to encode any flexible rules separate from the implementation allowing for easy modification.
In Biztalk we have the notion of “dehydrating” Orchestration instances to the Message Box – Windows Worfklow supports this as well and provides a default implementation for SQL Server but you can plug your own implementation, Tracking support (e.g. Business Activity Monitoring ) is there as well to allow you collect information on your Workflow but there are no fully-featured Business Activity Monitoring tools in the box but you can write them..
Instead of trying to think where you would use Windows Workflow Foundation, you end up thinking where wouldn’t you! In any application you write you have workflow, typically the branching statements in pure code projects. Using Windows Workflow in place of this allows you to model your workflow using flexible design tools and easily change it on the fly – Office 12 demonstrates this really well.
This is a bit of a brain-dump, David Chappell's fantastic paper on Windows Workflow is a definite must-read to get a full overview, you can download it here.
Get the bits from here
WindowsWorkflow.net has just been launched and looks like a great community site with lots of samples