Exemple #1
0
        public override async Task ExecuteAsync(IWorkflowInvoker invoker, WorkflowExecutionContext workflowContext, CancellationToken cancellationToken)
        {
            if (workflowContext.IsFirstPass)
            {
                var activity = workflowContext.CurrentActivity;
                var result   = await invoker.ActivityInvoker.ResumeAsync(workflowContext, activity, cancellationToken);

                workflowContext.IsFirstPass = false;

                await result.ExecuteAsync(invoker, workflowContext, cancellationToken);
            }
            else
            {
                workflowContext.Halt();
            }
        }
Exemple #2
0
        public override async Task ExecuteAsync(IWorkflowInvoker invoker, WorkflowExecutionContext workflowContext, CancellationToken cancellationToken)
        {
            var activity = workflowContext.CurrentActivity;

            if (workflowContext.IsFirstPass && ContinueOnFirstPass)
            {
                var activityInvoker = workflowContext.ServiceProvider.GetRequiredService <IActivityInvoker>();
                var result          = await activityInvoker.ResumeAsync(workflowContext, activity, cancellationToken);

                workflowContext.IsFirstPass = false;

                await result.ExecuteAsync(invoker, workflowContext, cancellationToken);
            }
            else
            {
                workflowContext.ScheduleHaltingActivity(activity);
                workflowContext.Halt(activity);
            }
        }