共用方式為


WorkflowInstance.ApplyWorkflowChanges(WorkflowChanges) 方法

定義

將變更套用到 WorkflowChanges 物件指定的工作流程執行個體中。

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)

參數

workflowChanges
WorkflowChanges

指定工作流程執行個體之動態更新的 WorkflowChanges

例外狀況

工作流程執行階段引擎不在執行中。

範例

下列範例將示範如何呼叫 WorkflowInstance 物件的 ApplyWorkflowChanges。 這個範例是 Mainform.cs 的檔案中<訂購狀態機器 SDK>範例的一部分。 如需詳細資訊,請參閱 排序狀態機器範例

// 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

備註

如果工作流程執行個體尚未暫止,在套用變更之前,工作流程執行階段引擎會暫時停止執行個體。

適用於