SaveFromNWFXml

Save or update a workflow from the contents of a Nintex Workflow workflow (.nwf) file, specified as a string.

Syntax

public WorkflowMetaData SaveFromNWFXml(
	string workflowFile,
	string listName,
	string workflowName
)

Parameters

workflowFile
Type: System.String

Optional. An XML-encoded string, representing the contents of a Nintex Workflow workflow (.nwf) file.

listName
Type: System.String

Optional. The name of a SharePoint list. If a value is not specified, the workflow is saved as a site workflow; otherwise, the workflow is saved to the specified list as a list workflow.

workflowName
Type: System.String

Optional. The name of the workflow to be saved. If a value is not specified, the name specified in the contents of the Nintex Workflow 2013 export (.nwp) file is used; otherwise, the specified name is used.

Returns

Type: WorkflowMetaData

Metadata about the saved or updated workflow.

Remarks

A Nintex Workflow workflow (.nwf) file is an XML file created by exporting an existing workflow from the Nintex Workflow designer. For more information about export files, see Export files.

This method cannot convert list workflows to site workflows, or site workflows to list workflows. If the export file contains the definition for a reusable or list workflow, you must save it to a SharePoint list. If the export file contains the definition for a site workflow, you must save it to a SharePoint site. Otherwise, an error occurs.

If a workflow with the same name already exists, this method overwrites the existing workflow and updates version-specific workflow metadata accordingly. If you do not want to overwrite an existing workflow, use the SaveFromNWFXmlNoOverwrite method.

This method saves, but does not publish, a workflow. To publish a workflow directly from the XML contents of a export file, you can use the PublishFromNWFXml method, or any of the related methods.

Example: Saving a new workflow

The following example demonstrates how to use this operation to save a workflow from the contents of a export file.

Request

The following SOAP request attempts to save a new workflow named SavedWorkflow, defined from the contents of a export file, to the TestContacts list.

Note: A portion of the value for the workflowFile element has been removed for readability.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:nin="http://nintex.com">
   <soap:Header/>
   <soap:Body>
      <nin:SaveFromNWFXml>
         <nin:workflowFile>
            &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
            &lt;ExportedWorkflowWithListMetdata xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;
            http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
            ...
            &lt;/ExportedWorkflowWithListMetdata&gt;
         </nin:workflowFile>
         <nin:listName>TestContacts</nin:listName>
         <nin:workflowName>SavedWorkflow</nin:workflowName>
      </nin:SaveFromNWFXml>
   </soap:Body>
</soap:Envelope>

Response

The following SOAP response indicates that the list workflow was successfully saved, and provides metadata about the saved workflow.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <SaveFromNWFXmlResponse xmlns="http://nintex.com">
         <SaveFromNWFXmlResult>
            <Name>SavedWorkflow</Name>
            <ModifiedBy>TestUser</ModifiedBy>
            <WorkflowDescription/>
            <EcbId>b4febab5-2c8a-41a7-894b-b0d3ab4469ef</EcbId>
            <Published>0001-01-01T00:00:00</Published>
            <LocalTimePublishedString>12/30/1899 11:00 AM</LocalTimePublishedString>
            <TimeLastModified>2015-01-26T15:01:18Z</TimeLastModified>
            <LocalTimeLastModifiedString>1/27/2015 2:01 AM</LocalTimeLastModifiedString>
            <ChangeInformation/>
            <WorkflowId>d7ff89b8-1e5a-4463-b486-5971f2d6afcc</WorkflowId>
            <WorkflowTypeDisplayName>List workflow</WorkflowTypeDisplayName>
            <UIVersion>0.1</UIVersion>
            <IsPublished>false</IsPublished>
            <PreviouslyPublished>false</PreviouslyPublished>
            <ListId>a70e0491-1b11-4277-ab30-8241aba19b6b</ListId>
            <MajorVersion>0</MajorVersion>
            <MinorVersion>1</MinorVersion>
            <Notifications/>
         </SaveFromNWFXmlResult>
      </SaveFromNWFXmlResponse>
   </soap:Body>
</soap:Envelope>

Example: Updating an existing workflow

The following example demonstrates how to use this operation to update an existing workflow from the contents of a export file.

The example assumes that the previous example, in Example: Saving a new workflow, was executed, and that this example updates the workflow saved in the previous example.

Request

The following SOAP request attempts to update an existing list workflow named SavedWorkflow, defined from the contents of a export file, to the TestContacts list.

Note: A portion of the value for the workflowFile element has been removed for readability.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:nin="http://nintex.com">
   <soap:Header/>
   <soap:Body>
      <nin:SaveFromNWFXml>
         <nin:workflowFile>
            &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
            &lt;ExportedWorkflowWithListMetdata xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;
            http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
            ...
            &lt;/ExportedWorkflowWithListMetdata&gt;
         </nin:workflowFile>
         <nin:listName>TestContacts</nin:listName>
         <nin:workflowName>SavedWorkflow</nin:workflowName>
      </nin:SaveFromNWFXml>
   </soap:Body>
</soap:Envelope>

Response

The following SOAP response indicates that the existing workflow was successfully updated, and provides metadata about the updated workflow. The version-specific metadata for the updated workflow, such as the UIVersion and MinorVersion elements, are updated accordingly.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <SaveFromNWFXmlResponse xmlns="http://nintex.com">
         <SaveFromNWFXmlResult>
            <Name>SavedWorkflow</Name>
            <ModifiedBy>TestUser</ModifiedBy>
            <WorkflowDescription/>
            <EcbId>b4febab5-2c8a-41a7-894b-b0d3ab4469ef</EcbId>
            <Published>0001-01-01T00:00:00</Published>
            <LocalTimePublishedString>12/30/1899 11:00 AM</LocalTimePublishedString>
            <TimeLastModified>2015-01-26T15:30:26Z</TimeLastModified>
            <LocalTimeLastModifiedString>1/27/2015 2:30 AM</LocalTimeLastModifiedString>
            <ChangeInformation/>
            <WorkflowId>d7ff89b8-1e5a-4463-b486-5971f2d6afcc</WorkflowId>
            <WorkflowTypeDisplayName>List workflow</WorkflowTypeDisplayName>
            <UIVersion>0.2</UIVersion>
            <IsPublished>false</IsPublished>
            <PreviouslyPublished>false</PreviouslyPublished>
            <ListId>a70e0491-1b11-4277-ab30-8241aba19b6b</ListId>
            <MajorVersion>0</MajorVersion>
            <MinorVersion>2</MinorVersion>
            <Notifications/>
         </SaveFromNWFXmlResult>
      </SaveFromNWFXmlResponse>
   </soap:Body>
</soap:Envelope>

See Also

Concepts

Export files

Operations

Exporting and importing workflows

Reference

ExportWorkflow

SaveFromNWF

SaveFromNWFNoOverwrite

SaveFromNWFXmlNoOverwrite

Web Service Reference