Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

WorkflowInvoker Class

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

System.Object
  System.Activities.WorkflowInvoker

Namespace:  System.Activities
Assembly:  System.Activities (in System.Activities.dll)
'Declaration
Public NotInheritable Class WorkflowInvoker

The WorkflowInvoker type exposes the following members.

  NameDescription
Public methodWorkflowInvokerInitializes a new instance of the WorkflowInvoker class.
Top
  NameDescription
Public propertyExtensionsGets the Collection(Of T) of extensions that are available to workflows invoked by a WorkflowInvoker instance.
Top
  NameDescription
Public methodBeginInvoke(AsyncCallback, Object)Invokes a workflow asynchronously using the specified AsyncCallback and user-provided state.
Public methodBeginInvoke(IDictionary(Of String, Object), AsyncCallback, Object)Invokes a workflow asynchronously using the specified IDictionary(Of TKey, TValue) of input parameters, AsyncCallback, and user-provided state.
Public methodBeginInvoke(TimeSpan, AsyncCallback, Object)Invokes a workflow asynchronously using the specified time-out interval, AsyncCallback, and user-provided state.
Public methodBeginInvoke(IDictionary(Of String, Object), TimeSpan, AsyncCallback, Object)Invokes a workflow asynchronously using the specified IDictionary(Of TKey, TValue) of input parameters, time-out interval, AsyncCallback, and user-provided state.
Public methodCancelAsyncAttempts to cancel the workflow that was invoked with the specified userState.
Public methodEndInvokeReturns the results of a workflow that was invoked using one of the BeginInvoke overloads.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodInvokeInvokes a workflow synchronously using the workflow definition passed to the WorkflowInvoker(Activity) constructor.
Public methodStatic memberInvoke(Activity)Invokes a workflow synchronously using the specified workflow definition.
Public methodInvoke(IDictionary(Of String, Object))Invokes the activity passed to the WorkflowInvoker(Activity) constructor synchronously with the specified IDictionary(Of TKey, TValue) of input parameters.
Public methodInvoke(TimeSpan)Invokes a workflow synchronously with the specified time-out interval.
Public methodStatic memberInvoke(Activity, IDictionary(Of String, Object))Invokes a workflow synchronously using the specified workflow definition and IDictionary(Of TKey, TValue) of input parameters.
Public methodStatic memberInvoke(Activity, TimeSpan)Invokes a workflow synchronously using the specified workflow definition and time-out interval.
Public methodInvoke(IDictionary(Of String, Object), TimeSpan)Invokes the activity passed to the WorkflowInvoker(Activity) constructor synchronously with the specified IDictionary(Of TKey, TValue) of input parameters and the specified time-out interval.
Public methodStatic memberInvoke(Activity, IDictionary(Of String, Object), TimeSpan)Invokes a workflow synchronously using the specified workflow definition, IDictionary(Of TKey, TValue) of input parameters, and time-out interval.
Public methodStatic memberInvoke(Of TResult)(Activity(Of TResult))Invokes a workflow synchronously using the workflow definition passed to the WorkflowInvoker(Activity) constructor.
Public methodStatic memberInvoke(Of TResult)(Activity(Of TResult), IDictionary(Of String, Object))Invokes a workflow synchronously using the specified workflow definition and IDictionary(Of TKey, TValue) of input parameters.
Public methodStatic memberInvoke(Of TResult)(Activity(Of TResult), IDictionary(Of String, Object), TimeSpan)Invokes a workflow synchronously using the specified workflow definition, IDictionary(Of TKey, TValue) of input parameters, and time-out interval.
Public methodStatic memberInvoke(Of TResult)(Activity(Of TResult), IDictionary(Of String, Object), IDictionary(Of String, Object), TimeSpan)Invokes a workflow synchronously using the specified workflow definition, IDictionary(Of TKey, TValue) of input parameters, IDictionary(Of TKey, TValue) of additional output parameters, and time-out interval.
Public methodInvokeAsyncInvokes a workflow asynchronously.
Public methodInvokeAsync(Object)Invokes a workflow asynchronously using the specified unique identifier.
Public methodInvokeAsync(IDictionary(Of String, Object))Invokes a workflow asynchronously using the specified IDictionary(Of TKey, TValue) of input parameters.
Public methodInvokeAsync(TimeSpan)Invokes a workflow asynchronously with the specified time-out interval.
Public methodInvokeAsync(IDictionary(Of String, Object), Object)Invokes a workflow asynchronously using the specified IDictionary(Of TKey, TValue) of input parameters and a unique identifier.
Public methodInvokeAsync(IDictionary(Of String, Object), TimeSpan)Invokes a workflow asynchronously with the specified IDictionary(Of TKey, TValue) of input parameters and the specified time-out interval.
Public methodInvokeAsync(TimeSpan, Object)Invokes a workflow asynchronously with the specified time-out interval and a unique identifier.
Public methodInvokeAsync(IDictionary(Of String, Object), TimeSpan, Object)Invokes a workflow asynchronously with the specified IDictionary(Of TKey, TValue) of input parameters, the specified time-out interval, and a unique identifier.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top
  NameDescription
Public eventInvokeCompletedOccurs when the workflow invoked by one of the InvokeAsync overloads is completed or canceled.
Top

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(AsyncCallback, Object) and EndInvoke(IAsyncResult) method pairs, or the InvokeAsync(IDictionary(Of String, Object)) method.

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);


.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.