SPWorkflowAssociation.ImportFromXml Method
Creates an SPWorkflowAssociation object from an XML formatted string.
Namespace: Microsoft.SharePoint.Workflow
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
Public Shared Function ImportFromXml ( _
rootWeb As SPWeb, _
xml As String _
) As SPWorkflowAssociation
'Usage
Dim rootWeb As SPWeb
Dim xml As String
Dim returnValue As SPWorkflowAssociation
returnValue = SPWorkflowAssociation.ImportFromXml(rootWeb, _
xml)
public static SPWorkflowAssociation ImportFromXml(
SPWeb rootWeb,
string xml
)
Parameters
rootWeb
Type: Microsoft.SharePoint.SPWebThe SPWeb object that contains the BaseTemplate of the association.
xml
Type: System.StringAn XML string that contains the state of all persisted properties of the association.
Return Value
Type: Microsoft.SharePoint.Workflow.SPWorkflowAssociation
The SPWorkflowAssociation reconstructed from the XML string.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | rootWeb is null . |
ArgumentOutOfRangeException | xml is null or empty. |
Remarks
This method creates a new workflow association from the XML data represented by the xml parameter.