Exposing and Invoking ActivityActions

This topic applies to Windows Workflow Foundation 4 (WF4).

This sample demonstrates how to develop a custom activity that has an ActivityAction. It also demonstrates how to use this activity by providing an implementation of the ActivityAction.

An ActivityAction allows an activity author to expose “holes” with specific signatures where the activity user can plug in a custom behavior. For example, the ForEach activity, (which operates over a collection of items), has an ActivityAction that allows the activity user to plug in behavior that operates on the current iteration item.

To set up, build, and run the sample

  1. Open the ActivityAction.sln sample solution in Visual Studio 2010.

  2. Build and run the solution.

Dd759023.Important(en-us,VS.100).gif Note:
The samples may already be installed on your computer. Check for the following (default) directory before continuing.

<InstallDrive>:\WF_WCF_Samples

If this directory does not exist, go to Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) Samples for .NET Framework 4 to download all Windows Communication Foundation (WCF) and WF samples. This sample is located in the following directory.

<InstallDrive>:\WF_WCF_Samples\WF\Basic\CustomActivities\Code-Bodied\ActivityAction