WorkflowApplication.BeginTerminate Method

Definition

Terminates a workflow instance asynchronously using the IAsyncResult asynchronous design pattern.

Overloads

BeginTerminate(String, TimeSpan, AsyncCallback, Object)

Terminates a workflow instance asynchronously using the specified error message, time-out interval, callback method, and user-provided state.

BeginTerminate(Exception, AsyncCallback, Object)

Terminates a workflow instance asynchronously using the specified exception, callback method, and user-provided state.

BeginTerminate(String, AsyncCallback, Object)

Terminates a workflow instance asynchronously using the specified error message, callback method, and user-provided state.

BeginTerminate(Exception, TimeSpan, AsyncCallback, Object)

Terminates a workflow instance asynchronously using the specified exception, time-out interval, callback method, and user-provided state.

Remarks

For more information, see Asynchronous Programming Overview.

BeginTerminate(String, TimeSpan, AsyncCallback, Object)

Terminates a workflow instance asynchronously using the specified error message, time-out interval, callback method, and user-provided state.

public IAsyncResult BeginTerminate (string reason, TimeSpan timeout, AsyncCallback callback, object state);

Parameters

reason
String

The reason for terminating the workflow instance.

timeout
TimeSpan

The interval in which the BeginTerminate operation must complete before the operation is canceled and a TimeoutException is thrown.

callback
AsyncCallback

The method to be called when the BeginTerminate operation has completed.

state
Object

An optional application-specific object that contains information about the asynchronous operation.

Returns

A reference to the asynchronous BeginTerminate operation.

Remarks

This method schedules the termination of the workflow instance. To be notified when the termination has completed, use the Completed handle.

To determine whether the BeginTerminate operation was successful, call EndTerminate. EndTerminate can be called from inside or outside of the method reference in the callback parameter. If EndTerminate is called before the BeginTerminate operation completes, it blocks until the BeginTerminate operation completes. If the BeginTerminate operation does not complete within the specified time-out interval a TimeoutException is thrown from EndTerminate.

This method terminates a workflow instance asynchronously using the IAsyncResult asynchronous design pattern. For more information, see Asynchronous Programming Overview.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

BeginTerminate(Exception, AsyncCallback, Object)

Terminates a workflow instance asynchronously using the specified exception, callback method, and user-provided state.

public IAsyncResult BeginTerminate (Exception reason, AsyncCallback callback, object state);

Parameters

reason
Exception

The reason the workflow instance is terminated.

callback
AsyncCallback

The method to be called when the BeginTerminate operation has completed.

state
Object

An optional application-specific object that contains information about the asynchronous operation.

Returns

A reference to the current BeginTerminate operation.

Remarks

This method schedules the termination of the workflow instance. To be notified when the termination has completed, use the Completed handle.

To determine whether the BeginTerminate operation was successful, call EndTerminate. EndTerminate can be called from inside or outside of the method referenced in the callback parameter. If EndTerminate is called before the BeginTerminate operation completes, it blocks until the BeginTerminate operation completes. By default, the BeginTerminate operation must complete in 30 seconds or a TimeoutException is thrown from EndTerminate.

This method terminates a workflow asynchronously using the IAsyncResult asynchronous design pattern. For more information, see Asynchronous Programming Overview.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

BeginTerminate(String, AsyncCallback, Object)

Terminates a workflow instance asynchronously using the specified error message, callback method, and user-provided state.

public IAsyncResult BeginTerminate (string reason, AsyncCallback callback, object state);

Parameters

reason
String

The reason for terminating the workflow instance.

callback
AsyncCallback

The method to be called when the BeginTerminate operation has completed.

state
Object

An optional application-specific object that contains information about the asynchronous operation.

Returns

A reference to the current BeginTerminate operation.

Remarks

This method schedules the termination of the workflow instance. To be notified when the termination has completed, use the Completed handle.

To determine whether the BeginTerminate operation was successful, call EndTerminate. EndTerminate can be called from inside or outside of the method reference in the callback parameter. If EndTerminate is called before the BeginTerminate operation completes, it blocks until the BeginTerminate operation completes. By default, the BeginTerminate operation must complete in 30 seconds or a TimeoutException is thrown from EndTerminate.

This method terminates a workflow instance asynchronously using the IAsyncResult asynchronous design pattern. For more information, see Asynchronous Programming Overview.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

BeginTerminate(Exception, TimeSpan, AsyncCallback, Object)

Terminates a workflow instance asynchronously using the specified exception, time-out interval, callback method, and user-provided state.

public IAsyncResult BeginTerminate (Exception reason, TimeSpan timeout, AsyncCallback callback, object state);

Parameters

reason
Exception

The reason for terminating the workflow instance.

timeout
TimeSpan

The interval in which the BeginTerminate operation must complete before the operation is canceled and a TimeoutException is thrown.

callback
AsyncCallback

The method to be called when the BeginTerminate operation has completed.

state
Object

An optional application-specific object that contains information about the asynchronous operation.

Returns

A reference to the current BeginTerminate operation.

Remarks

This method schedules the termination of the workflow instance. To be notified when the termination has completed, use the Completed handle.

To determine whether the BeginTerminate operation was successful, call EndTerminate. EndTerminate can be called from inside or outside of the callback method. If EndTerminate is called before the BeginTerminate operation completes, it blocks until the BeginTerminate operation completes. If the BeginTerminate operation does not complete within the specified time-out interval a TimeoutException is thrown. This or any other exceptions that occur during the BeginTerminate process is thrown from EndTerminate.

This method terminates a workflow asynchronously using the IAsyncResult asynchronous design pattern. For more information, see Asynchronous Programming Overview.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1