Share via


SPWorkflowAssociation class

Represents the association of a workflow template with a specific list or content type, and contains members that return custom information about that workflow's association with the specific list or content type.

Inheritance hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPAutoSerializingObject
    Microsoft.SharePoint.Workflow.SPWorkflowAssociation

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

Syntax

'Declaration
<SubsetCallableTypeAttribute> _
Public NotInheritable Class SPWorkflowAssociation _
    Inherits SPAutoSerializingObject _
    Implements IComparer
'Usage
Dim instance As SPWorkflowAssociation
[SubsetCallableTypeAttribute]
public sealed class SPWorkflowAssociation : SPAutoSerializingObject, 
    IComparer

Remarks

A workflow association represents the binding of a workflow template to a specific list or content type. Workflow associations enable you to specify properties of the workflow as it applies to the specific list or content type to which you bind it.

A given workflow template can be bound to the same list or content type multiple times, resulting in multiple workflow associations.

For more information, see Workflow Stages.

To associate a workflow template with a website, use the Add(SPWorkflowAssociation) method on the WorkflowAssociations property of the SPWeb object.

To associate a workflow template with a list or document library, use the Add(SPWorkflowAssociation) method on the WorkflowAssociations property of the SPList object.

To associate a workflow template with a content type, use the Add(SPWorkflowAssociation) method on the WorkflowAssociations property of the SPContentType object.

All of these methods take an SPWorkflowAssociation() object and add it to the specified website, list, or content type. To create the appropriate workflow association, use the CreateWebAssociation(SPWorkflowTemplate, String, SPList, SPList), CreateListAssociation, CreateListContentTypeAssociation, or CreateWebContentTypeAssociation method of the SPWorkflowAssociation object itself.

Use the Remove(SPWorkflowAssociation) method on the WorkflowAssociations property of the SPWeb, SPList, or SPContentType object to remove a workflow association from a website, list, or content type.

Thread safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See also

Reference

SPWorkflowAssociation members

Microsoft.SharePoint.Workflow namespace

Other resources

Workflows in Windows SharePoint Services

Workflow Development for Windows SharePoint Services

Workflow Object Model in Windows SharePoint Services Overview