This topic has not yet been rated - Rate this topic

SPWorkflowAssociation.CreateWebAssociation Method

SharePoint 2010

Creates a workflow association that can then be added to an SPWeb object.

Namespace:  Microsoft.SharePoint.Workflow
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
public static SPWorkflowAssociation CreateWebAssociation(
	SPWorkflowTemplate baseTemplate,
	string name,
	SPList taskList,
	SPList historyList
)

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.
taskList
Type: Microsoft.SharePoint.SPList
The task list on which to create workflow tasks for this workflow association.
historyList
Type: Microsoft.SharePoint.SPList
The list to which to log workflow history events.

Return Value

Type: Microsoft.SharePoint.Workflow.SPWorkflowAssociation
A workflow association that can be added to an SPWeb object.
Exception Condition
ArgumentNullException

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

ArgumentException

The name parameter consists completely of white-space.

You can add the workflow association that is returned by this method by calling the AddWorkflowAssociation(SPWorkflowAssociation) method of an SPWeb object.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ