Workflow Base Activity Classes

This topic applies to Windows Workflow Foundation 4.

Custom and system-provided activities in .NET Framework version 4 are created using a hierarchy of classes from the library. All root activity classes have Activity as a base class. Activities must inherit from Activity, CodeActivity, or NativeActivity, or be dynamically created using DynamicActivity. Activities can also derive from the root activity variations that return a result: Activity, CodeActivity, or NativeActivity, or be dynamically created using DynamicActivity,

Activity

Activities that inherit from Activity are composite activities that use system-provided or custom activities compiled together to produce functionality. These custom activities are the most basic to create, but also have access to fewer features than activities based on other classes. Activities that inherit from Activity do not have access to run-time features and only offer argument and variable resolution.

Code Activity

Activities that inherit from CodeActivity are able to override the Execute method to produce custom functionality, but do not have access to all of the features of the workflow runtime (such as the ability to schedule activities or create bookmarks.)

AsyncCodeActivity

AsyncCodeActivity is similar to CodeActivity, with the added functionality of being executed asynchronously. Asynchronous activities are required to take advantage of the asynchronous activity scheduling offered by Parallel.

Native Activity

Activities that inherit from NativeActivity have the most access to workflow run-time functionality. Like CodeActivity, the Execute method can be overridden to create custom functionality. NativeActivity activities can schedule children, create bookmarks, invoke asynchronous work, flow in transactions, have their execution aborted or canceled, and access execution properties and extensions.

Dynamic Activity

Unlike other activity classes, activities do not inherit from DynamicActivity. Instead, the Implementation property is modified to include new activities at runtime to create custom functionality, and the Properties argument is modified to define the signature of the activity.

See Also

Tasks

Workflow Activity Authoring Using the Activity Class

Other Resources

Using CodeActivity
Using NativeActivity