SPContentType.AddWorkflowAssociation method
NOTE: This API is now obsolete.
Use the WorkflowAssociations.Add method.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
<ObsoleteAttribute("Use WorkflowAssociations.Add() instead")> _
Public Function AddWorkflowAssociation ( _
workflowAssociation As SPWorkflowAssociation _
) As SPWorkflowAssociation
'Usage
Dim instance As SPContentType
Dim workflowAssociation As SPWorkflowAssociation
Dim returnValue As SPWorkflowAssociation
returnValue = instance.AddWorkflowAssociation(workflowAssociation)
[ObsoleteAttribute("Use WorkflowAssociations.Add() instead")]
public SPWorkflowAssociation AddWorkflowAssociation(
SPWorkflowAssociation workflowAssociation
)
Parameters
workflowAssociation
Type: Microsoft.SharePoint.Workflow.SPWorkflowAssociationThe workflow association to add to the content type’s collection.
Return value
Type: Microsoft.SharePoint.Workflow.SPWorkflowAssociation
The workflow association.
Exceptions
Exception | Condition |
---|---|
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). |