Registers a task response to a Flexi task task in the specified task list.


public ProcessTaskResponseResult ProcessFlexiTaskResponse2(
	string comments,
	string outcome,
	int spTaskId,
	string taskListName


Type: System.String

Optional. Comments to include with the task response.

Type: System.String

Required. The name of the configured outcome for the task response.

Note: Although the parameter is optional, an error occurs if a value is not specified.

Type: System.Int32

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.

Type: System.String

Optional. The name or GUID of the task list that contains the task.

Note: Although the parameter is optional, an error occurs if a value is not specified.


Type: ProcessTaskResponseResult

ProcessTaskResponseResult.Success is returned if the response is successfully processed for the task; otherwise, one of the other enumeration values is returned.


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.

If the value specified in outcome does not match the name of a configured outcome for the task, an error occurs. The value must match the Name property of a ConfiguredOutcome defined for the specified task. For more information about configured outcomes, see GetOutcomesForFlexiTask.

A value may be ignored, optional, or required in comments, depending on the configured outcome specified in outcome. To check whether a particular configured outcome does not allow, allows, or requires comments, use the CommentsMode property of the ConfiguredOutcome that matches the configured outcome specified in outcome to determine whether a value is ignored, optional, or required in comments.

The approver of 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 assignees specified by the Flexi task action that created the task item, this method returns ProcessTaskResponseResult.InvalidUser and the task is not updated.

Task Locking

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 process a task response for a task item.


The following SOAP request attempts to process a task response, in which the outcome is set to Approve, for the task item with an identifier of 1 in the Workflow Tasks task list.

<soap:Envelope xmlns:soap="" xmlns:nin="">
         <nin:comments>Sample comments</nin:comments>
         <nin:taskListName>Workflow Tasks</nin:taskListName>


The following SOAP response indicates that the task response was successfully processed.

<soap:Envelope xmlns:soap="" 
      <ProcessFlexiTaskResponse2Response xmlns="">

See Also


Workflow tasks


Processing workflow task responses


Web Service Reference