SPWorkflowManager.CountWorkflows Method (SPWorkflowTemplate, SPSite)
Returns the number of workflow instances for the specified workflow template, on the specified site collection.
Namespace: Microsoft.SharePoint.Workflow
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
Public Function CountWorkflows ( _
template As SPWorkflowTemplate, _
site As SPSite _
) As Integer
'Usage
Dim instance As SPWorkflowManager
Dim template As SPWorkflowTemplate
Dim site As SPSite
Dim returnValue As Integer
returnValue = instance.CountWorkflows(template, _
site)
public int CountWorkflows(
SPWorkflowTemplate template,
SPSite site
)
Parameters
template
Type: Microsoft.SharePoint.Workflow.SPWorkflowTemplateThe workflow template for which you want the number of workflow instances.
site
Type: Microsoft.SharePoint.SPSiteThe site collection across which you want the number of workflow instances.
Return Value
Type: System.Int32
A 32-bit integer that represents the number of workflow associations.
Remarks
This method gets the number of workflows associated with the template specified by the template parameter for the collection of websites specified by the site parameter.
See Also
Reference
Microsoft.SharePoint.Workflow Namespace
Other Resources
Workflows in SharePoint Foundation