Esempio n. 1
0
        private async ValueTask <IActivityExecutionResult?> TryExecuteActivityAsync(
            ActivityOperation activityOperation,
            ActivityExecutionContext activityExecutionContext,
            RuntimeActivityInstance activity,
            CancellationToken cancellationToken)
        {
            try
            {
                return(await activityOperation(activityExecutionContext, activity));
            }
            catch (Exception e)
            {
                _logger.LogWarning(e, "Failed to run activity {ActivityId} of workflow {WorkflowInstanceId}", activity.Id, activityExecutionContext.WorkflowInstance.Id);
                activityExecutionContext.Fault(e);
                await _mediator.Publish(new ActivityFaulted(e, activityExecutionContext), cancellationToken);
            }

            return(null);
        }
 public ValidateWorkflowActivityExecution(ActivityExecutionContext activityExecutionContext, RuntimeActivityInstance activity)
 {
     ActivityExecutionContext = activityExecutionContext;
     Activity = activity;
 }