แก้ไข

แชร์ผ่าน


WorkflowInvoker Class

Definition

Provides a means for invoking a workflow as if it were a method call.

public ref class WorkflowInvoker sealed
public sealed class WorkflowInvoker
type WorkflowInvoker = class
Public NotInheritable Class WorkflowInvoker
Inheritance
WorkflowInvoker

Examples

The following example synchronously invokes a workflow consisting of a single WriteLine activity using WorkflowInvoker.

Activity wf = new WriteLine
{
    Text = "Hello World."
};

WorkflowInvoker.Invoke(wf);

Remarks

WorkflowInvoker contains both instance and static methods for invoking workflows synchronously, and instance methods for invoking workflows asynchronously.

WorkflowInvoker does not allow instance control such as persisting, unloading, or resuming bookmarks. If instance control is desired, use WorkflowApplication instead.

To execute workflows synchronously with no instance control, call the Invoke method. To execute a workflow asynchronously with no instance control, use the BeginInvoke and EndInvoke method pairs, or the InvokeAsync method.

Constructors

WorkflowInvoker(Activity)

Initializes a new instance of the WorkflowInvoker class.

Properties

Extensions

Gets the Collection<T> of extensions that are available to workflows invoked by a WorkflowInvoker instance.

Methods

BeginInvoke(AsyncCallback, Object)

Invokes a workflow asynchronously using the specified AsyncCallback and user-provided state.

BeginInvoke(IDictionary<String,Object>, AsyncCallback, Object)

Invokes a workflow asynchronously using the specified IDictionary<TKey,TValue> of input parameters, AsyncCallback, and user-provided state.

BeginInvoke(IDictionary<String,Object>, TimeSpan, AsyncCallback, Object)

Invokes a workflow asynchronously using the specified IDictionary<TKey,TValue> of input parameters, time-out interval, AsyncCallback, and user-provided state.

BeginInvoke(TimeSpan, AsyncCallback, Object)

Invokes a workflow asynchronously using the specified time-out interval, AsyncCallback, and user-provided state.

CancelAsync(Object)

Attempts to cancel the workflow that was invoked with the specified userState.

EndInvoke(IAsyncResult)

Returns the results of a workflow that was invoked using one of the BeginInvoke overloads.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
Invoke()

Invokes a workflow synchronously using the workflow definition passed to the WorkflowInvoker(Activity) constructor.

Invoke(Activity, IDictionary<String,Object>, TimeSpan)

Invokes a workflow synchronously using the specified workflow definition, IDictionary<TKey,TValue> of input parameters, and time-out interval.

Invoke(Activity, IDictionary<String,Object>)

Invokes a workflow synchronously using the specified workflow definition and IDictionary<TKey,TValue> of input parameters.

Invoke(Activity, TimeSpan)

Invokes a workflow synchronously using the specified workflow definition and time-out interval.

Invoke(Activity)

Invokes a workflow synchronously using the specified workflow definition.

Invoke(IDictionary<String,Object>, TimeSpan)

Invokes the activity passed to the WorkflowInvoker(Activity) constructor synchronously with the specified IDictionary<TKey,TValue> of input parameters and the specified time-out interval.

Invoke(IDictionary<String,Object>)

Invokes the activity passed to the WorkflowInvoker(Activity) constructor synchronously with the specified IDictionary<TKey,TValue> of input parameters.

Invoke(TimeSpan)

Invokes a workflow synchronously with the specified time-out interval.

Invoke<TResult>(Activity<TResult>, IDictionary<String,Object>, IDictionary<String,Object>, TimeSpan)

Invokes a workflow synchronously using the specified workflow definition, IDictionary<TKey,TValue> of input parameters, IDictionary<TKey,TValue> of additional output parameters, and time-out interval.

Invoke<TResult>(Activity<TResult>, IDictionary<String,Object>, TimeSpan)

Invokes a workflow synchronously using the specified workflow definition, IDictionary<TKey,TValue> of input parameters, and time-out interval.

Invoke<TResult>(Activity<TResult>, IDictionary<String,Object>)

Invokes a workflow synchronously using the specified workflow definition and IDictionary<TKey,TValue> of input parameters.

Invoke<TResult>(Activity<TResult>)

Invokes a workflow synchronously using the workflow definition passed to the WorkflowInvoker(Activity) constructor.

InvokeAsync()

Invokes a workflow asynchronously.

InvokeAsync(IDictionary<String,Object>, Object)

Invokes a workflow asynchronously using the specified IDictionary<TKey,TValue> of input parameters and a unique identifier.

InvokeAsync(IDictionary<String,Object>, TimeSpan, Object)

Invokes a workflow asynchronously with the specified IDictionary<TKey,TValue> of input parameters, the specified time-out interval, and a unique identifier.

InvokeAsync(IDictionary<String,Object>, TimeSpan)

Invokes a workflow asynchronously with the specified IDictionary<TKey,TValue> of input parameters and the specified time-out interval.

InvokeAsync(IDictionary<String,Object>)

Invokes a workflow asynchronously using the specified IDictionary<TKey,TValue> of input parameters.

InvokeAsync(Object)

Invokes a workflow asynchronously using the specified unique identifier.

InvokeAsync(TimeSpan, Object)

Invokes a workflow asynchronously with the specified time-out interval and a unique identifier.

InvokeAsync(TimeSpan)

Invokes a workflow asynchronously with the specified time-out interval.

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Events

InvokeCompleted

Occurs when the workflow invoked by one of the InvokeAsync overloads is completed or canceled.

Applies to