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