Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
StateMachineWorkflowInstance Class
Collapse the table of content
Expand the table of content

StateMachineWorkflowInstance Class

Note: This API is now obsolete.

Represents a class that manages the current instance of a StateMachineWorkflowActivity. This class cannot be inherited.


Namespace:  System.Workflow.Activities
Assembly:  System.Workflow.Activities (in System.Workflow.Activities.dll)

[ObsoleteAttribute("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
public sealed class StateMachineWorkflowInstance

The StateMachineWorkflowInstance type exposes the following members.

Public methodStateMachineWorkflowInstanceInitializes a new instance of the StateMachineWorkflowInstance class.

Public propertyCurrentStateGets the currently executing StateActivity.
Public propertyCurrentStateNameGets the name of the current StateActivity.
Public propertyInstanceIdGets the Guid that indicates the current instance of the StateMachineWorkflowActivity.
Public propertyPossibleStateTransitionsGets a collection of state transitions that the current StateActivity can make.
Public propertyStateHistoryGets a collection of state activities that the state machine workflow instance has transitioned through.
Public propertyStateMachineWorkflowGets the latest definition of the StateMachineWorkflowActivity.
Public propertyStatesGets a list of StateActivity classes in the StateMachineWorkflow.
Public propertyWorkflowInstanceGets the current WorkflowInstance.

Public methodEnqueueItem(IComparable, Object)Posts a message to the StateMachineWorkflowInstance.
Public methodEnqueueItem(IComparable, Object, IPendingWork, Object)Posts a message to the StateMachineWorkflowInstance.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodSetState(StateActivity)Provides a transition to a specified StateActivity.
Public methodSetState(String)Provides a transition to a specified StateActivity using the name of the StateActivity.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)


This material discusses types and namespaces that are obsolete. For more information, see Deprecated Types in Windows Workflow Foundation 4.5.

This class also provides the query interface over the current instance of the StateMachineWorkflowActivity. By using an instance of this class, you can make various queries on the StateMachineWorkflowInstance.

Typical queries that can be made are as follows:

  • Current state of the state machine.

  • Possible transitions from the current state.

  • History of transitions for the state machine instance.

  • Enumeration of all the states in the state machine.

.NET Framework

Supported in: 4, 3.5, 3.0
Obsolete (compiler warning) in 4.6
Obsolete (compiler warning) in 4.6
Obsolete (compiler warning) in 4.5
Obsolete (compiler warning) in 4.5.1
Obsolete (compiler warning) in 4.5.2

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