Пример #1
0
        public async Task <WorkflowExecutionContext> StartWorkflowAsync(Workflow workflow, IActivity startActivity, Variables arguments, CancellationToken cancellationToken)
        {
            var workflowInstance = await workflowSerializer.DeriveAsync(workflow, cancellationToken);

            var workflowContext = await invoker.InvokeAsync(workflowInstance, startActivity, arguments, cancellationToken);

            await workflowStore.AddAsync(workflowInstance, cancellationToken);

            return(workflowContext);
        }
Пример #2
0
 /// <summary>
 /// Invokes a workflow asynchronously using the specified input object
 /// as input parameters, the specified time-out interval, and a unique
 /// identifier.
 /// </summary>
 /// <typeparam name="TInput">The type of the input.</typeparam>
 /// <param name="invoker">The invoker.</param>
 /// <param name="inputs">The input object which is turned into a
 /// dictionary by <see cref="ObjectExtensions.ToDict"/>.</param>
 /// <param name="timeout">The interval in which the workflow must
 /// complete before it is aborted and a System.TimeoutException is
 /// thrown.</param>
 /// <param name="userState">A user-provided object used to distinguish
 /// this particular asynchronous invoke operation from other current
 /// asynchronous invoke operations.</param>
 public static void InvokeAsync <TInput>(this IWorkflowInvoker invoker, TInput inputs, TimeSpan timeout, object userState)
     where TInput : class
 {
     invoker.InvokeAsync(inputs.ToDict(), timeout, userState);
 }
Пример #3
0
 /// <summary>
 /// Invokes a workflow asynchronously using the specified input object
 /// as input parameters and a unique identifier.
 /// </summary>
 /// <typeparam name="TInput">The type of the input.</typeparam>
 /// <param name="invoker">The invoker.</param>
 /// <param name="inputs">The input object which is turned into a
 /// dictionary by <see cref="ObjectExtensions.ToDict"/>.</param>
 /// <param name="userState">A user-provided object used to distinguish
 /// this particular asynchronous invoke operation from other current
 /// asynchronous invoke operations.</param>
 public static void InvokeAsync <TInput>(this IWorkflowInvoker invoker, TInput inputs, object userState)
 {
     invoker.InvokeAsync(inputs.ToDict(), userState);
 }
Пример #4
0
 /// <summary>
 /// Invokes a workflow asynchronously using the specified input object
 /// as input parameters.
 /// </summary>
 /// <typeparam name="TInput">The type of the input.</typeparam>
 /// <param name="invoker">The invoker.</param>
 /// <param name="inputs">The input object which is turned into a
 /// dictionary by <see cref="ObjectExtensions.ToDict"/>.</param>
 public static void InvokeAsync <TInput>(this IWorkflowInvoker invoker, TInput inputs)
     where TInput : class
 {
     invoker.InvokeAsync(inputs.ToDict());
 }