Creating workflow activities

Implementing custom workflow activities

In SharePoint, workflow activities are derived from the Activity class, in the System.Workflow.ComponentModel namespace. In Nintex Workflow 2013, custom workflow activities can be derived from the Activity class, but such workflow activities incur additional overhead for reporting purposes. Internally, Nintex Workflow 2013 adds hidden workflow activities to workflows, to support reporting functionality in Nintex Workflow 2013 for each workflow action. These hidden workflow activities, ReportingActivity, ReportingHeaderActivity, and ReportingFooterActivity, report the execution status of a workflow activity, and can log additional information to the workflow history for the workflow containing the workflow activity.

Note: Although listed as obsolete, the types in the System.Workflow namespaces are used by both SharePoint 2013 and Nintex Workflow 2013 to support both SharePoint 2010 and SharePoint 2013 workflows. Do not use the types provided in the System.Activities namespaces to develop custom workflow activities.

You can avoid this additional overhead by deriving your custom workflow activity from the ProgressTrackingActivity class, in the Nintex.Workflow.Activities namespace. The ProgressTrackingActivity class, which is in turn derived from the Activity class, supports reporting functionality for Nintex Workflow 2013 export (.nwp) file from within the class itself, eliminating the need for external reporting activities to be added to the workflow for your custom workflow activity. This not only reduces overhead for your custom workflow activity, but also allows you to write messages for your custom workflow activity to the workflow history as well.

Note: Nintex recommends that you use the ProgressTrackingActivity class to create custom workflow activities.

For more information about implementing a custom workflow activity derived from the ProgressTrackingActivity class, see Implementing the workflow activity.

Implementing error handling

Custom workflow actions based on custom workflow activities in Nintex Workflow 2013 can support inline error handling, in which the custom workflow action can catch and handle exceptions that may occur while it is executing within a workflow. Error handling requires specific implementations in the custom workflow activity, the custom workflow action adapter, and the configuration page for the custom workflow action. For more information about error handling support in custom workflow actions, see Supporting error handling.

Custom workflow activities require special dependency properties, to pass error information to the custom workflow action adapter, and a specific exception handling design pattern. For more information about implementing error handling in a custom workflow activity, see Implementing error handling in the workflow activity.

Implementing multiple output

As with error handling, custom workflow actions based on custom workflow activities in Nintex Workflow 2013 export (.nwp) file can support multiple output, in which multiple values can be captured and stored in workflow variables during the execution of the custom workflow action. For more information about multiple output support in custom workflow actions, see Supporting multiple output.

And, as with error handling, custom workflow activities require special dependency properties, to store the collection of identifiers received from the workflow action adapter for the values to be captured and to return the collection of captured values to the workflow action adapter. For more information about implementing multiple support in a custom workflow activity, see Implementing multiple output in the workflow activity.

See Also

Concepts

Workflow activities

Workflow action adapters

Configuration pages

Operations

Working with workflow actions

Working with workflow activities

Reference

.NET Framework Reference