SPWorkflowManager.GetWorkflowTasks Method (SPListItem, Guid, SPWorkflowFilter)
Returns a filtered collection of the tasks belonging to the specified workflow instance.
Namespace: Microsoft.SharePoint.Workflow
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
Public Function GetWorkflowTasks ( _
item As SPListItem, _
workflowInstanceId As Guid, _
filter As SPWorkflowFilter _
) As SPWorkflowTaskCollection
'Usage
Dim instance As SPWorkflowManager
Dim item As SPListItem
Dim workflowInstanceId As Guid
Dim filter As SPWorkflowFilter
Dim returnValue As SPWorkflowTaskCollection
returnValue = instance.GetWorkflowTasks(item, _
workflowInstanceId, filter)
public SPWorkflowTaskCollection GetWorkflowTasks(
SPListItem item,
Guid workflowInstanceId,
SPWorkflowFilter filter
)
Parameters
item
Type: Microsoft.SharePoint.SPListItemThe list item on which the workflow is running.
workflowInstanceId
Type: System.GuidThe ID of the workflow instance for which you want the task collection returned.
filter
Type: Microsoft.SharePoint.Workflow.SPWorkflowFilterThe filter criteria to apply to the workflow task collection, such as to whom the workflow is assigned, and the workflow state.
Return Value
Type: Microsoft.SharePoint.Workflow.SPWorkflowTaskCollection
An SPWorkflowTaskCollection object that represents the collection of workflow tasks.
Remarks
This method gets the workflow tasks associated with the workflow with the ID specified by the workflowInstanceId parameter running on the list item specified by the item parameter that satisfy the criteria specified by the filter parameter.
See Also
Reference
Microsoft.SharePoint.Workflow Namespace
Other Resources
Workflows in SharePoint Foundation