SPWorkflowManager.GetWorkflowTasks method (SPListItem, Guid)

Returns a collection of all tasks belonging to the specified workflow instance.

Namespace:  Microsoft.SharePoint.Workflow
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Function GetWorkflowTasks ( _
    item As SPListItem, _
    workflowInstanceId As Guid _
) As SPWorkflowTaskCollection
'Usage
Dim instance As SPWorkflowManager
Dim item As SPListItem
Dim workflowInstanceId As Guid
Dim returnValue As SPWorkflowTaskCollection

returnValue = instance.GetWorkflowTasks(item, _
    workflowInstanceId)
public SPWorkflowTaskCollection GetWorkflowTasks(
    SPListItem item,
    Guid workflowInstanceId
)

Parameters

  • workflowInstanceId
    Type: System.Guid

    The ID of the workflow instance for which you want the task collection returned.

Return value

Type: Microsoft.SharePoint.Workflow.SPWorkflowTaskCollection
An SPWorkflowTaskCollection object that represent 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.

See also

Reference

SPWorkflowManager class

SPWorkflowManager members

GetWorkflowTasks overload

Microsoft.SharePoint.Workflow namespace

Other resources

Workflows in Windows SharePoint Services

Workflow Development for Windows SharePoint Services

Workflow Object Model in Windows SharePoint Services Overview