SPWorkItemCollection Class

A collection of SPWorkItem object instances. Derives from Microsoft.SharePoint.SPBaseCollection.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.Administration.SPAutoSerializingObject
    Microsoft.SharePoint.SPBaseCollection
      Microsoft.SharePoint.SPWorkItemCollection

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
Public Class SPWorkItemCollection _
    Inherits SPBaseCollection
'Usage
Dim instance As SPWorkItemCollection
public class SPWorkItemCollection : SPBaseCollection

Remarks

The SPWorkItemCollection class is used in conjunction with the SPWorkItemJobDefinition class, and clients that implement the Microsoft.SharePoint.ISPWorkItemHost interface. Classes derived from SPWorkItemJobDefinition are designed to be driven by the SPTimerService. The SPWorkItemCollection class uses a SQL query to filter work items before queuing them in batches for processing. Work item collections are homogenous by type. That is, each SPWorkItemCollection object contains work items of only one WorkItemType.

Note

There are two primary hosting classes that you can use to process work items: SPSite and SPContentDatabase. Using SPSite as host gives you greater flexibility; using SPContentDatabase allows you to use the SPWorkItemJobDefinition class to process work items at the broadest scope possible—the scope of the content database.

The SPWorkItemJobDefinition class is useful only for processing work item collections and uses the GetWorkItems method to process at one time all of the site collections (SPSite) that are in the content database.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

SPWorkItemCollection Members

Microsoft.SharePoint Namespace

Microsoft.SharePoint.SPWorkItem

Microsoft.SharePoint.SPWorkItemStatus

Microsoft.SharePoint.SPBaseCollection

Microsoft.SharePoint.Administration.SPContentDatabase

Microsoft.SharePoint.Administration.SPTimerService

Microsoft.SharePoint.Administration.SPWorkItemJobDefinition