CountWorkflows Method (SPWorkflowTemplate, SPSite)

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

public int CountWorkflows(
	SPWorkflowTemplate template,
	SPSite site


Type: Microsoft.SharePoint.Workflow.SPWorkflowTemplate

The workflow template for which you want the number of workflow instances.

Type: Microsoft.SharePoint.SPSite

The 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.

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.

© 2016 Microsoft