This topic has not yet been rated - Rate this topic

SPWorkflowAssociation.CreateSiteContentTypeAssociation Method

NOTE: This API is now obsolete.

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)
Available in Sandboxed Solutions: No
[ObsoleteAttribute("Use CreateWebContentTypeAssociation() instead")]
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.
Exception Condition
ArgumentNullException

The argument passed to the baseTemplate parameter is null; or the argument to the name parameter is null; or the template requires a task list (the default) and the argument to the taskList parameter is null; or the template requires a history list (the default) and the argument to the historyList parameter is null.

ArgumentException

The string passed to the name parameter consists completely of white-space.

To associate a workflow with a content type, use the AddWorkflowAssociation method of the SPContentType object. This method takes an SPWorkflowAssociation object and adds it to the specified content type.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Use CreateWebContentTypeAssociation instead
This function is now obsolete. You should use CreateWebContentTypeAssociation() instead.