Represents the association of a workflow template with a specific list or content type, and that contains members that return custom information about that workflow's association with the specific list or content type.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)] [SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel = true)] [SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)] public sealed class SPWorkflowAssociation : SPAutoSerializingObject, IComparer
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 to a list or document library, use the AddWorkflowAssociation method of the SPList object. To associate a workflow with a content type, use the AddWorkflowAssociation method of the SPContentType object. Both of these methods take an SPWorkflowAssociation object and add it to the specified list or content type, respectively. To create the appropriate workflow association, use the CreateListAssociation, CreateListContentTypeAssociation, or CreateSiteContentTypeAssociation method of the SPWorkflowAssociation object itself.
Use the RemoveWorkflowAssociation(SPWorkflowAssociation) method to remove a workflow association from a list, and the [SPContentType.RemoveWorkflowAssociation] method to remove a workflow association from a site or list content type.