Custom Activities
Most of the provided activities for Windows Workflow Foundation are related to the structure of a workflow, communications with a workflow, or the lifetime of a workflow. The really important activities are ones related to the application domain of the software you are building. These are all created with custom activities.
InvokeMethod Activity in Communications Library
A workflow communications library project type can be built to create activities that either invoke or handle events. Once built, these appear on the toolbox and can be used to communicate between the workflow and an external system.
The InvokeMethod activity calls out from the workflow to an external system.
EventSink in Communications Library Activity
The EventSink activity waits for an event from outside the workflow. These events arrive via the host process. The EventSink activity can be correlated with a related InvokeMethod call.
There is a discussion of InvokeMethod and EventSink in Chapter 9.
Composite Activity in Activity Library
If you build an Activity Library project template in Visual Studio 2005 you can build an activity yourself easily. You can build an activity using the activity designer (see Figure 3.25), which creates a composite activity from a sequence of pre-existing activities.
Figure 3.25 The composite activity designer.
Coded Activity in Activity Library
In the same Activity Library project type you can code an activity in C# or Visual Basic .NET. To do this you change the base class property for the activity from System.Workflow.Activities.Sequence to System.Workflow.ComponentModel.Activity.
See Chapter 7 for more details about creating custom activities.