WF in .NET - Part I

Windows Workflow Foundation (WF)

WF in .NET Framework version 4 changes several development paradigms from previous versions. Workflows are now easier to create, execute, and maintain, and implement a host of new functionality.

Activity Model

The activity is now the base unit of creating a workflow, rather than using the SequentialWorkflowActivity or StatemachineWorkflowActivity classes. The Activity class provides the base abstraction of workflow behavior. Activity authors can then implement either CodeActivity for basic custom activity functionality, or NativeActivity for custom activity functionality that uses the breadth of the runtime. Activity is a class used by activity authors to express new behaviors declaratively in terms of other NativeActivity, CodeActivity, AsyncCodeActivity , or DynamicActivity objects, whether they are custom-developed or included in the .NET Framework 4 Built-In Activity Library.

Composite Activity Options

Flowchart is a powerful new control flow activity that allows authors to model arbitrary loops and conditional branching. Flowchart provides an event-driven programming model that was previously only able to be implemented with StateMachineWorkflowActivity. Procedural workflows benefit from new flow-control activities that model traditional flow-control structures, such as TryCatch and Switch.

New features of the activity library include:

  • New flow control activities, such as,DoWhile, Pick, TryCatch,foreach, Switch, and Paralelforeach.
  • Activities for manipulating member data, such as Assign and collection activities such as AddToCollection.
  • Activities for controlling transactions, such as TransactionScope and Compensate.
  • New messaging activities such as SendContent and RecieveReply.

Explicit Activity Data Model

.NET Framework 4 includes new options for storing or moving data. Data can be stored in an activity using Variable. When moving data in and out of an activity, specialized argument types are used to determine which direction data is moving. These types are InArgument, InOutArgument, and OutArgument.

Thanks

I hope you find this blog useful.

Omid Edivandi
Next Recommended Reading WF in .NET Part 3