PublishFromNWFXmlSkipValidationNoOverwrite
Publishes a new workflow without validation from the contents of a Nintex Workflow workflow (.nwf) file, specified as a string.
Syntax
public bool PublishFromNWFXmlSkipValidationNoOverwrite( string workflowFile, string listName, string workflowName, bool saveIfCannotPublish )
Parameters
- workflowFile
- Type: System.String
Optional. An XML-encoded string, representing the contents of a NintexWorkflow 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 (.nwf) file is used; otherwise, the specified name is used.
- saveIfCannotPublish
- Type: System.Boolean
Required. Set to true to save the workflow if validation errors prevent publishing the workflow; otherwise, set to false.
Returns
Type: Boolean
true if the workflow is successfully published.
Remarks
A Nintex Workflow workflow (.nwf) file is an XML file created by exporting an existing workflow from the NintexWorkflow 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 publish it to a SharePoint list. If the export file contains the definition for a site workflow, you must publish it to a SharePoint site. Otherwise, an error occurs.
If a workflow with the same name already exists, this method returns an error. Otherwise, this method then creates and publishes a new workflow.
If you want to validate the contents of the workflow prior to publication, or overwrite an existing workflow, the following related methods are available:
-
Use the PublishFromNWFXml method if you want to validate the workflow and overwrite an existing workflow.
-
Use the PublishFromNWFXmlNoOverwrite method if you want to validate the workflow and prevent overwriting an existing workflow.
-
Use the PublishFromNWFXmlSkipValidation method if you want to skip validation and overwrite an existing workflow.
This method publishes a workflow, optionally attempting to save the workflow only if an error occurs during publication and the saveIfCannotPublish parameter is set to true. To save a workflow directly from the contents of a export file, without publishing the workflow, you can use the SaveFromNWFXml method, or any of the related methods.
Example
The following example demonstrates how to use this operation to publish a workflow from the contents of a export file.
Request
The following SOAP request attempts to publish a workflow named PublishedWorkflow, defined from the contents of a export file, to the TestContacts2 list, optionally saving the workflow if it cannot be published.
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:PublishFromNWFXmlSkipValidationNoOverwrite> <nin:workflowFile> <?xml version="1.0" encoding="utf-8"?> <ExportedWorkflowWithListMetdata xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"> ... </ExportedWorkflowWithListMetdata> </nin:workflowFile> <nin:listName>TestContacts2</nin:listName> <nin:workflowName>PublishedWorkflow</nin:workflowName> <nin:saveIfCannotPublish>true</nin:saveIfCannotPublish> </nin:PublishFromNWFXmlSkipValidationNoOverwrite> </soap:Body> </soap:Envelope>
Response
The following SOAP response indicates that the workflow was successfully published.
<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> <PublishFromNWFXmlSkipValidationNoOverwriteResponse xmlns="http://nintex.com"> <PublishFromNWFXmlSkipValidationNoOverwriteResult>true</PublishFromNWFXmlSkipValidationNoOverwriteResult> </PublishFromNWFXmlSkipValidationNoOverwriteResponse> </soap:Body> </soap:Envelope>
See Also
Concepts
Operations
Exporting and importing workflows