StateMachineWorkflowInstance.SetState Method

Definition

Provides a transition to a StateActivity.

Overloads

SetState(String)

Provides a transition to a specified StateActivity using the name of the StateActivity.

SetState(StateActivity)

Provides a transition to a specified StateActivity.

SetState(String)

Provides a transition to a specified StateActivity using the name of the StateActivity.

C#
public void SetState(string targetStateName);

Parameters

targetStateName
String

The name of the StateActivity to transition to.

Exceptions

targetStateName is a null reference (Nothing in Visual Basic).

The StateActivity specified by targetStateName is a null reference (Nothing).

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SetState(StateActivity)

Provides a transition to a specified StateActivity.

C#
public void SetState(System.Workflow.Activities.StateActivity targetState);

Parameters

targetState
StateActivity

The StateActivity to transition to.

Exceptions

targetState is a null reference (Nothing in Visual Basic).

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1