This documentation is archived and is not being maintained.

SPWorkflowAssociation.CreateListContentTypeAssociation Method

Windows SharePoint Services 3

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)

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)


Type: Microsoft.SharePoint.Workflow.SPWorkflowTemplate
The workflow template on which to base this workflow association.
Type: System.String
The name to give this workflow association.
Type: Microsoft.SharePoint.SPList
The task list on which to create workflow tasks for this workflow association.
Type: Microsoft.SharePoint.SPList
The list to which to log workflow history events.

Return Value

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

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.