SPWorkItemCollection.ProcessingThrottle Property
Gets or sets a value that specifies the maximum number of workflow instances that can be obtained on a given query for runnable work items.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
Public Property ProcessingThrottle As Integer
Get
Set
'Usage
Dim instance As SPWorkItemCollection
Dim value As Integer
value = instance.ProcessingThrottle
instance.ProcessingThrottle = value
public int ProcessingThrottle { get; set; }
Property Value
Type: System.Int32
Returns and integer specifying the maximum number of workflow instances.
Remarks
The batch ID for a workflow is the SPWorkflow.InstanceId property of the workflow. The instance ID, then, is taken from workflows and passed to the SPWorkItem.BatchId property of the work item instance.
If the count of the number of batch IDs exceeds the value for ProcessingThrottle, the query to get runnable work items returns an empty set, effectively shutting down processing of work items.
This has the added effect of ensuring that code is robust enough to handle asynchronous behaviors and process work items at a later time, potentially on a different computer.