Share via


WorkflowAssociationCollection.Add Method

Creates a new workflow association based on properties specified in the parameters object, and adds an object representing that workflow association to the collection.

Namespace:  Microsoft.SharePoint.Client.Workflow
Assemblies:   Microsoft.SharePoint.Client.Silverlight (in Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

Syntax

'Declaration
<RemoteAttribute> _
Public Function Add ( _
    parameters As WorkflowAssociationCreationInformation _
) As WorkflowAssociation
'Usage
Dim instance As WorkflowAssociationCollection
Dim parameters As WorkflowAssociationCreationInformation
Dim returnValue As WorkflowAssociation

returnValue = instance.Add(parameters)
[RemoteAttribute]
public WorkflowAssociation Add(
    WorkflowAssociationCreationInformation parameters
)

Parameters

Return Value

Type: Microsoft.SharePoint.Client.Workflow.WorkflowAssociation
Returns a WorkflowAssociation instance representing the creation of a new workflow association based on properties specified in the parameters object, and adds an object representing that workflow association to the collection.

Exceptions

Exception Condition
[System.ArgumentException]

There already exists a workflow association with a name equal to parameters.Name, or parameters.Name is an empty string. Error code: -2147024809.

[System.ArgumentNullException]

For all workflow associations, the value of one of the following properties of the parameters object is a null reference (Nothing in Visual Basic): Name, Template. Or, for all workflow associations except those on site content types, the value of one of the following properties of the parameters object is a null reference (Nothing in Visual Basic): HistoryList, TaskList. Or, for workflow associations on site content types, the values of one of the following pairs of properties of the parameters object are a null reference (Nothing in Visual Basic): HistoryList and ContentTypeAssociation?HistoryListName, or TaskList and ContentTypeAssociationTaskListName. Error Code: -2147467261

See Also

Reference

WorkflowAssociationCollection Class

WorkflowAssociationCollection Members

Microsoft.SharePoint.Client.Workflow Namespace