WorkflowInstance.ApplyWorkflowChanges Method (WorkflowChanges)


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


Type: System.Workflow.ComponentModel.WorkflowChanges

A WorkflowChanges specifying dynamic updates for the workflow instance.

Exception Condition

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
catch (WorkflowValidationFailedException)
    // New state has already been added
    MessageBox.Show("On Hold state has already been added to this workflow.");

.NET Framework
Available since 3.0
Return to top