WorkflowInstance.ApplyWorkflowChanges(WorkflowChanges) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Applies changes to the workflow instance specified by the WorkflowChanges object.
public:
void ApplyWorkflowChanges(System::Workflow::ComponentModel::WorkflowChanges ^ workflowChanges);
public void ApplyWorkflowChanges (System.Workflow.ComponentModel.WorkflowChanges workflowChanges);
member this.ApplyWorkflowChanges : System.Workflow.ComponentModel.WorkflowChanges -> unit
Public Sub ApplyWorkflowChanges (workflowChanges As WorkflowChanges)
Parameters
- workflowChanges
- WorkflowChanges
A WorkflowChanges specifying dynamic updates for the workflow instance.
Exceptions
The workflow runtime engine is not running.
Examples
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.");
}
' Apply the changes to the workflow instance
Try
instance.ApplyWorkflowChanges(changes)
Catch e As WorkflowValidationFailedException
' New state has already been added
MessageBox.Show("On Hold state has already been added to this workflow.")
End Try
Remarks
If the workflow instance is not already suspended, the workflow runtime engine temporarily suspends the instance before applying the changes.