SPWorkflowAssociation.Enabled property

Gets or sets a value that indicates whether the workflow association is enabled.

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

Syntax

'Declaration
<ClientCallableAttribute> _
Public Property Enabled As Boolean
    Get
    Set
'Usage
Dim instance As SPWorkflowAssociation
Dim value As Boolean

value = instance.Enabled

instance.Enabled = value
[ClientCallableAttribute]
public bool Enabled { get; set; }

Property value

Type: System.Boolean
true if it is enabled; otherwise, false.

Exceptions

Exception Condition
InvalidOperationException

The corresponding workflow feature is deactivated or the workflow is not deployed as part of a feature.

Remarks

Setting the Enabled property to false causes the workflow association not to be displayed in the user interface. This prevents users from starting new instances of the workflow. In addition, workflows that are configured to start automatically are no longer able to start automatically.

Setting the Enabled property to true does not change the values for the AllowManual, AutoStartCreate, or AutoStartChange properties. However, the option to start the workflow is again available in the user interface, and workflows that are configured to start automatically will start automatically.

See also

Reference

SPWorkflowAssociation class

SPWorkflowAssociation members

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