SPContentType.AddWorkflowAssociation method

NOTE: This API is now obsolete.

Use the WorkflowAssociations.Add method.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

[ObsoleteAttribute("Use WorkflowAssociations.Add() instead")]
public SPWorkflowAssociation AddWorkflowAssociation(
	SPWorkflowAssociation workflowAssociation
)

Parameters

workflowAssociation
Type: Microsoft.SharePoint.Workflow.SPWorkflowAssociation

The workflow association to add to the content type’s collection.

Return value

Type: Microsoft.SharePoint.Workflow.SPWorkflowAssociation
The workflow association.

ExceptionCondition
ArgumentException

The SPWorkflowAssociation object already exists in the collection, or it is based on an inappropriate workflow template.

ArgumentNullException

The SPWorkflowAssociation object is a null reference (Nothing in Visual Basic).

Show: