WorkflowApplication.BeginRun 方法

定義

使用 IAsyncResult 非同步設計模式,以非同步方式啟動或繼續工作流程執行個體。Starts or resumes a workflow instance asynchronously using the IAsyncResult asynchronous design pattern.

多載

BeginRun(AsyncCallback, Object)

使用指定的回呼方法及使用者提供的狀態,以非同步方式啟動或繼續工作流程執行個體。Starts or resumes a workflow instance asynchronously using the specified callback method and user-provided state.

BeginRun(TimeSpan, AsyncCallback, Object)

使用指定的逾時間隔、回呼方法及使用者提供的狀態,以非同步方式啟動或繼續工作流程執行個體。Starts or resumes a workflow instance asynchronously using the specified time-out interval, callback method, and user-provided state.

備註

如需詳細資訊, 請參閱非同步程式設計總覽For more information, see Asynchronous Programming Overview.

BeginRun(AsyncCallback, Object)

使用指定的回呼方法及使用者提供的狀態,以非同步方式啟動或繼續工作流程執行個體。Starts or resumes a workflow instance asynchronously using the specified callback method and user-provided state.

public:
 IAsyncResult ^ BeginRun(AsyncCallback ^ callback, System::Object ^ state);
public IAsyncResult BeginRun (AsyncCallback callback, object state);
member this.BeginRun : AsyncCallback * obj -> IAsyncResult
Public Function BeginRun (callback As AsyncCallback, state As Object) As IAsyncResult

參數

callback
AsyncCallback

繼續作業完成時要呼叫的方法。The method to be called when the resume operation has completed.

state
Object

選擇性的應用程式特定物件,其中包含非同步作業的相關資訊。An optional application-specific object that contains information about the asynchronous operation.

傳回

非同步執行作業的參考。A reference to the asynchronous run operation.

備註

若要判斷執行作業是否成功,請呼叫EndRunTo determine whether the run operation was successful, call EndRun. EndRun 可以從 callback 參數中參考的方法之內或之外呼叫。EndRun can be called from inside or outside of the method referenced in the callback parameter. 如果在繼續作業完成之前呼叫 EndRun,它會封鎖直到繼續作業完成為止。If EndRun is called before the resume operation completes, it blocks until the resume operation completes. 根據預設,繼續作業必須在 30 秒內完成,否則會從 TimeoutException 擲回 EndRunBy default, the resume operation must complete in 30 seconds or a TimeoutException is thrown from EndRun.

這個方法會使用 IAsyncResult 非同步設計模式來非同步啟動或繼續工作流程。This method starts or resumes a workflow asynchronously using the IAsyncResult asynchronous design pattern. 如需詳細資訊, 請參閱非同步程式設計總覽For more information, see Asynchronous Programming Overview.

BeginRun(TimeSpan, AsyncCallback, Object)

使用指定的逾時間隔、回呼方法及使用者提供的狀態,以非同步方式啟動或繼續工作流程執行個體。Starts or resumes a workflow instance asynchronously using the specified time-out interval, callback method, and user-provided state.

public:
 IAsyncResult ^ BeginRun(TimeSpan timeout, AsyncCallback ^ callback, System::Object ^ state);
public IAsyncResult BeginRun (TimeSpan timeout, AsyncCallback callback, object state);
member this.BeginRun : TimeSpan * AsyncCallback * obj -> IAsyncResult
Public Function BeginRun (timeout As TimeSpan, callback As AsyncCallback, state As Object) As IAsyncResult

參數

timeout
TimeSpan

繼續作業必須在作業取消並擲回 TimeoutException 前完成的間隔。The interval in which the resume operation must complete before the operation is canceled and a TimeoutException is thrown.

callback
AsyncCallback

繼續作業完成時要呼叫的方法。The method to be called when the resume operation has completed.

state
Object

選擇性的應用程式特定物件,其中包含非同步作業的相關資訊。An optional application-specific object that contains information about the asynchronous operation.

傳回

非同步執行作業的參考。A reference to the asynchronous run operation.

備註

若要判斷執行作業是否成功,請呼叫EndRunTo determine whether the run operation was successful, call EndRun. EndRun 可以從 callback 參數中參考的方法之內或之外呼叫。EndRun can be called from inside or outside of the method reference in the callback parameter. 如果在繼續作業完成之前呼叫 EndRun,它會封鎖直到繼續作業完成為止。If EndRun is called before the resume operation completes, it blocks until the resume operation completes. 如果繼續作業沒有在指定的逾時間隔內完成,則會從 TimeoutException 擲回 EndRunIf the resume operation does not complete within the specified time-out interval a TimeoutException is thrown from EndRun.

這個方法會使用 IAsyncResult 非同步設計模式來非同步啟動或繼續工作流程。This method starts or resumes a workflow asynchronously using the IAsyncResult asynchronous design pattern. 如需詳細資訊, 請參閱非同步程式設計總覽For more information, see Asynchronous Programming Overview.

適用於