Export (0) Print
Expand All

WorkflowInstance.ApplyWorkflowChanges Method

Applies changes to the workflow instance specified by the WorkflowChanges object.

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

public void ApplyWorkflowChanges(
	WorkflowChanges workflowChanges
)

Parameters

workflowChanges
Type: System.Workflow.ComponentModel.WorkflowChanges

A WorkflowChanges specifying dynamic updates for the workflow instance.

ExceptionCondition
InvalidOperationException

The workflow runtime engine is not running.

If the workflow instance is not already suspended, the workflow runtime engine temporarily suspends the instance before applying the changes.

The following example demonstrates calling ApplyWorkflowChanges to a WorkflowInstance object. This example is from the Ordering State Machine SDK sample, from the Mainform.cs file. For more information, see the Ordering State Machine Sample.

// Apply the changes to the workflow instance 
try
{
    instance.ApplyWorkflowChanges(changes);
}
catch (WorkflowValidationFailedException)
{
    // New state has already been added
    MessageBox.Show("On Hold state has already been added to this workflow.");
}

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft