This documentation is archived and is not being maintained.

SPWorkflowAssociation.CreateSiteContentTypeAssociation Method

Windows SharePoint Services 3

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

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

public static SPWorkflowAssociation CreateSiteContentTypeAssociation(
	SPWorkflowTemplate baseTemplate,
	string name,
	string strTaskList,
	string strHistoryList
)

Parameters

baseTemplate
Type: Microsoft.SharePoint.Workflow.SPWorkflowTemplate
The workflow template on which to base this workflow association.
name
Type: System.String
The name to give this workflow association.
strTaskList
Type: System.String
The task list on which to create workflow tasks for this workflow association.
strHistoryList
Type: System.String
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.

Show: