Ejemplo n.º 1
0
 /// <inheritdoc/>
 public virtual async Task <V1WorkflowInstance> FaultAsync(V1FaultWorkflowInstanceCommand command, CancellationToken cancellationToken = default)
 {
     if (command == null)
     {
         throw new ArgumentNullException(nameof(command));
     }
     return(await this.Mediator.ExecuteAndUnwrapAsync(this.Mapper.Map <Application.Commands.WorkflowInstances.V1FaultWorkflowInstanceCommand>(command), cancellationToken));
 }
        /// <inheritdoc/>
        public virtual async Task <V1WorkflowInstance> FaultAsync(V1FaultWorkflowInstanceCommand command, CancellationToken cancellationToken = default)
        {
            var result = await this.RuntimeApi.FaultAsync(command, cancellationToken);

            if (!result.Succeeded)
            {
                throw new OperationResultException(new OperationResult(result.Code, result.Errors?.Select(e => new Neuroglia.Error(e.Code, e.Message))?.ToArray()));
            }
            return(result.Data !);
        }
Ejemplo n.º 3
0
 /// <inheritdoc/>
 public virtual async Task <GrpcApiResult <V1WorkflowInstance> > FaultAsync(V1FaultWorkflowInstanceCommand command, CallContext context = default)
 {
     return(GrpcApiResult.CreateFor(await this.Mediator.ExecuteAsync(Mapper.Map <Application.Commands.WorkflowInstances.V1FaultWorkflowInstanceCommand>(command), context.CancellationToken)));
 }