SPWorkflowAssociation.CreateListContentTypeAssociation Method

Creates a workflow association that can then be added to a list content type.

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

Syntax

Public Shared Function CreateListContentTypeAssociation ( _
    baseTemplate As SPWorkflowTemplate, _
    name As String, _
    taskList As SPList, _
    historyList As SPList _
) As SPWorkflowAssociation

Dim baseTemplate As SPWorkflowTemplate
Dim name As String
Dim taskList As SPList
Dim historyList As SPList
Dim returnValue As SPWorkflowAssociation

returnValue = SPWorkflowAssociation.CreateListContentTypeAssociation(baseTemplate, _
    name, taskList, historyList)
public static SPWorkflowAssociation CreateListContentTypeAssociation(
    SPWorkflowTemplate baseTemplate,
    string name,
    SPList taskList,
    SPList historyList
)

Parameters

  • name
    Type: System.String
    The name to give this workflow association.

Return Value

Type: Microsoft.SharePoint.Workflow.SPWorkflowAssociation
An SPWorkflowAssociation that represents the workflow association.

Remarks

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.

See Also

Reference

SPWorkflowAssociation Class

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