Esempio n. 1
0
 public async Task <ExecutionResult> HandleAsync(
     IStepExecutionContext context,
     IStepBody body,
     WorkflowStepDelegate next
     )
 {
     return(await GetRetryPolicy().ExecuteAsync(ctx => next(), new Dictionary <string, object>
     {
         { StepContextKey, context }
     }));
 }
        public async Task <ExecutionResult> HandleAsync(IStepExecutionContext context, IStepBody body,
                                                        WorkflowStepDelegate next)
        {
            _eventManager.OnStepStatusChanged(
                new WorkflowEventManager.StepStatusEventArgs(context, WorkflowEventManager.StepStatus.STARTED));
            var result = await next();

            _eventManager.OnStepStatusChanged(
                new WorkflowEventManager.StepStatusEventArgs(context, WorkflowEventManager.StepStatus.ENDED));

            return(result);
        }
        public async Task <ExecutionResult> HandleAsync(
            IStepExecutionContext context,
            IStepBody body,
            WorkflowStepDelegate next)
        {
            var workflowId = context.Workflow.Id;
            var stepId     = context.Step.Id;

            using (_log.BeginScope("WorkflowId => {@WorkflowId}", workflowId))
                using (_log.BeginScope("StepId => {@StepId}", stepId))
                {
                    return(await next());
                }
        }
Esempio n. 4
0
        public async Task <ExecutionResult> HandleAsync(
            IStepExecutionContext context,
            IStepBody body,
            WorkflowStepDelegate next)
        {
            var workflowId = context.Workflow.Id;
            var stepId     = context.Step.Id;

            // Uses log scope to add a few attributes to the scope
            using (_log.BeginScope("{@WorkflowId}", workflowId))
                using (_log.BeginScope("{@StepId}", stepId))
                {
                    // Calling next ensures step gets executed
                    return(await next());
                }
        }
Esempio n. 5
0
            public async Task <ExecutionResult> HandleAsync(IStepExecutionContext context, IStepBody body, WorkflowStepDelegate next)
            {
                StartTime = DateTime.UtcNow;
                await Task.Delay(Delay);

                var result = await next();

                await Task.Delay(Delay);

                EndTime = DateTime.UtcNow;
                return(result);
            }