ProcessFlexiTaskResponse2

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

Syntax

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

Parameters

comments
Type: System.String

Optional. Comments to include with the task response.

outcome
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.

spTaskId
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.

taskListName
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.

Returns

Type: ProcessTaskResponseResult

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

Remarks

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.

Example

The following example demonstrates how to use this operation to process a task response for a task item.

Request

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="http://www.w3.org/2003/05/soap-envelope" xmlns:nin="http://nintex.com">
   <soap:Header/>
   <soap:Body>
      <nin:ProcessFlexiTaskResponse2>
         <nin:comments>Sample comments</nin:comments>
         <nin:outcome>Approve</nin:outcome>
         <nin:spTaskId>1</nin:spTaskId>
         <nin:taskListName>Workflow Tasks</nin:taskListName>
      </nin:ProcessFlexiTaskResponse2>
   </soap:Body>
</soap:Envelope>

Response

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

<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>
      <ProcessFlexiTaskResponse2Response xmlns="http://nintex.com">
         <ProcessFlexiTaskResponse2Result>Success</ProcessFlexiTaskResponse2Result>
      </ProcessFlexiTaskResponse2Response>
   </soap:Body>
</soap:Envelope>

See Also

Concepts

Workflow tasks

Operations

Processing workflow task responses

Reference

Web Service Reference