Labels

Monday, June 20, 2011

Workflow in the .NET Framework 4

Goal
creating unified application logic
creating scalable applications with simple state management.
 Advantage
One obvious advantage of this approach is that the workflow doesn’t hang around in memory blocking a thread and using up a process while it’s waiting for input.
Another advantage is that a persisted workflow can potentially be re-loaded on a machine other than the one it was originally running on. Because of this, different parts of the workflow might end up running on different systems.
other advantages: It can make coordinating parallel work easier, providing automatic tracking of the workflow’s execution is straightforward. the main control flow of a workflow can be assembled graphically.

Overview
Base Activity Library (BAL), custom activities

Custom activities can be written directly in code, using C# or Visual Basic or another language. They can also be created by combining existing activities, which allows some interesting options. For example, it might be possible for less technical people to create WF applications using these pre-packaged chunks of custom functionality.

A workflow's state and control flow are typically described in eXtensible Application Markup Language (XAML), while custom activities can be written in code.

Workflow in the .NET Framework 4, it's not compatible with earlier version in 3.5
  • Sequence: Executes activities in sequence, one after another. The sequence can contain If activities, While activities, and other kinds of control flow. It’s not possible to go backwards, however—execution must always move forward.
  • Flowchart: Executes activities one after another, like a Sequence, but also allows control to return to an earlier step. This more flexible approach, new in the .NET Framework 4 release of WF, is closer both to how real processes work and to the way most of us think. 
 A workflow service uses WCF to expose WF-based logic
  • Implementing services that do parallel work is straightforward: just drop activities into a Parallel activity.
  • Tracking is provided by the runtime.
  • Depending on the problem domain, it might be possible to create reusable custom activities for use in other services.
  • The workflow can be created graphically, with the process logic directly visible in the WF workflow designer.
Where to run
WF workflows can run in pretty much any process. You’re free to create your own host, even replacing some of WF’s basic services (like persistence) if you’d like.
A simpler option is to host a WF workflow in a worker process provided by Internet Information Server (IIS). While this works, it provides only a bare-bones solution. Microsoft is providing a technology code-named “Dublin”. Implemented as extensions to IIS and the Windows Process Activation Service (WAS), a primary goal of “Dublin” is to make IIS and WAS more attractive as a host for workflow services.

Microsoft Windows Workflow Foundation

No comments:

Post a Comment