Registers a response to a workflow approval or review task in the specified task list.
public ProcessTaskResponseResult ProcessTaskResponse3( string comments, Outcome outcome, int spTaskId, string taskListName )
Optional. Comments to include with the task response.
Required. The outcome of the task response.
Required. The identifier of the list item for the task. This parameter must be set to a value other than zero (0); otherwise, an error occurs.
Optional. The name or GUID of the task list that contains the task.
Type: ProcessTaskResponseResult
ProcessTaskResponseResult.Success is returned if the response is successfully processed for the task; otherwise, one of the other enumeration values is returned.
This method does not support workflow data, to-do, or Flexi task tasks. You can use the UpdateListItems service operation, in the Lists web service provided by SharePoint, to process task responses for workflow data or to-do tasks, and the ProcessFlexiTaskResponse2 method, provided by Nintex Workflow 2013, to process task responses for Flexi task tasks.
If the value specified in spTaskId does not match the identifier of a running workflow task in the specified task list, an error occurs. For more information about running workflow tasks, see GetRunningWorkflowTasksForCurrentUserForListItem.
The approver for the task response is determined by the credentials of the user context specified when this method is invoked. If the credentials of the current user context do not match any of the approvers, assignees, or reviewers specified by the workflow action that created the task item, this method returns ProcessTaskResponseResult.InvalidUser and the task is not updated.
When the method executes, it attempts to obtain a lock on the specified task, so that the task can be safely updated. If a lock cannot be obtained, either because another process has locked the task or because an error occurred while attempting to obtain a lock, this method returns ProcessTaskResponseResult.CannotObtainLock and the task is not updated. For more information about task locking, see Processing workflow task responses.
The following example demonstrates how to use this operation to complete a workflow approval task in the default task list.
The following SOAP request attempts to complete a workflow approval task in the Workflow Tasks task list, the default task list for Nintex Workflow.
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:nin="http://nintex.com"> <soap:Header/> <soap:Body> <nin:ProcessTaskResponse3> <nin:comments>First attempt</nin:comments> <nin:outcome>Approved</nin:outcome> <nin:spTaskId>3</nin:spTaskId> <nin:taskListName>Workflow Tasks</nin:taskListName> </nin:ProcessTaskResponse3> </soap:Body> </soap:Envelope>
The following SOAP response indicates that the task response was successfully processed for the workflow to-do task.
<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> <ProcessTaskResponse3Response xmlns="http://nintex.com"> <ProcessTaskResponse3Result>Success</ProcessTaskResponse3Result> </ProcessTaskResponse3Response> </soap:Body> </soap:Envelope>
Processing workflow task responses