There are two approaches to building a custom activity. One approach uses composition and the second approach uses derivation.
The composition approach is a similar experience to authoring a workflow. We use the designer to drag, drop, and configure activities inside a new custom activity, and then package the custom activity into an assembly for use in other workflow projects. The composition approach is a quick and easy path to reusable workflow components.
In the derivation approach, we derive a new activity from the Activity
class. We can also derive from descendants of the Activity
class to inherit more functionality. We can customize the design view, validation, serialization, and code-generation pieces of the activity. The derivation approach gives us the highest level of control and offers a path to extending Windows Workflow with custom code.
We will examine both of these approaches, but start with the composition approach.