GetRunningWorkflowTasksForListItem

Gets a collection of running workflow tasks associated with the specified SharePoint list item.

Syntax

public UserTaskCollection GetRunningWorkflowTasksForListItem(
	int itemId,
	string listName
)

Parameters

itemId
Type: System.Int32

Required. The identifier of the SharePoint list item.

listName
Type: System.String

Optional. The name of the SharePoint list.

Returns

Type: UserTaskCollection

A collection of UserTask objects, each of which represents a running workflow task associated with the specified list item.

Remarks

If the list specified in listName or the list item specified in itemId is not found, an error occurs.

Example

The following example demonstrates how to use this operation to get the running workflow tasks on a list item.

Request

The following SOAP request attempts to retrieve the running workflow tasks for the list item with an identifier of 3, contained in the TestContacts1 list.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:nin="http://nintex.com">
   <soap:Header/>
   <soap:Body>
      <nin:GetRunningWorkflowTasksForListItem>
         <nin:itemId>3</nin:itemId>
         <nin:listName>TestContacts1</nin:listName>
      </nin:GetRunningWorkflowTasksForListItem>
   </soap:Body>
</soap:Envelope>

Response

The following SOAP response contains the collection of running workflow tasks for the list item.

<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>
      <GetRunningWorkflowTasksForListItemResponse xmlns="http://nintex.com">
         <GetRunningWorkflowTasksForListItemResult>
            <UserTask>
               <SharePointTaskId>1</SharePointTaskId>
               <HumanWorkflowID>1</HumanWorkflowID>
               <AssignedTo>
                  <OtherEmailAddress/>
                  <UserID>i:0#.w|testdomain\testuser</UserID>
                  <IsDomainGroup>false</IsDomainGroup>
                  <IsSPGroup>false</IsSPGroup>
                  <IsUser>false</IsUser>
               </AssignedTo>
               <Comments/>
               <EntryTime>2015-01-26T23:46:06.63</EntryTime>
               <WorkflowName>TestFlexiTaskWorkflow</WorkflowName>
               <WorkflowInstaceId>b5a45bc3-7871-4a69-ac3e-1fcce9cdc170</WorkflowInstaceId>
               <TaskName>Assign Flexi task</TaskName>
               <TaskType>MultiOutcome</TaskType>
            </UserTask>
            <UserTask>
               <SharePointTaskId>2</SharePointTaskId>
               <HumanWorkflowID>2</HumanWorkflowID>
               <AssignedTo>
                  <OtherEmailAddress/>
                  <UserID>i:0#.w|testdomain\differentuser</UserID>
                  <IsDomainGroup>false</IsDomainGroup>
                  <IsSPGroup>false</IsSPGroup>
                  <IsUser>false</IsUser>
               </AssignedTo>
               <Comments/>
               <EntryTime>2015-01-26T23:49:53.06</EntryTime>
               <WorkflowName>TestFlexiTaskWorkflow</WorkflowName>
               <WorkflowInstaceId>827a236d-593c-4b69-8e2b-709f6c65a0c8</WorkflowInstaceId>
               <TaskName>Assign Flexi task</TaskName>
               <TaskType>MultiOutcome</TaskType>
            </UserTask>
         </GetRunningWorkflowTasksForListItemResult>
      </GetRunningWorkflowTasksForListItemResponse>
   </soap:Body>
</soap:Envelope>

See Also

Concepts

Workflow tasks

Operations

Processing workflow task responses

Reference

ProcessFlexiTaskResponse2

ProcessTaskResponse3

Web Service Reference