Bagikan melalui


WorkflowInstance.Suspend(String) Metode

Definisi

Menangguhkan instans alur kerja.

public:
 void Suspend(System::String ^ error);
public void Suspend (string error);
member this.Suspend : string -> unit
Public Sub Suspend (error As String)

Parameter

error
String

Deskripsi alasan untuk menangguhkan instans alur kerja.

Pengecualian

Mesin runtime alur kerja tidak berjalan.

Contoh

Contoh kode berikut menunjukkan panggilan Tangguhkan pada WorkflowInstance objek.

// Create a workflow runtime
WorkflowRuntime workflowRuntime = new WorkflowRuntime();
// Create a workflow instance
WorkflowInstance workflowInstance = workflowRuntime.CreateWorkflow(typeof(Workflow1));
// Start the workflow
workflowInstance.Start();
// Suspend the workflow, passing in a message
workflowInstance.Suspend("Workflow manually suspended");
' Create a workflow runtime
Dim workflowRuntime As New WorkflowRuntime()
' Create a workflow instance
Dim workflowInstance As WorkflowInstance = workflowRuntime.CreateWorkflow(GetType(Workflow1))
' Start the workflow
workflowInstance.Start()
' Suspend the workflow, passing in a message
workflowInstance.Suspend("Workflow manually suspended")

Keterangan

Instans alur kerja ditangguhkan secara sinkron. Jika instans alur kerja sudah ditangguhkan, tidak ada tindakan yang diambil; jika tidak, mesin runtime alur kerja menangguhkan instans alur kerja, meningkatkan WorkflowSuspended peristiwa dan meneruskan reason dalam WorkflowSuspendedEventArgs.

Catatan

Suspend tidak membongkar instans alur kerja.

Berlaku untuk