Esempio n. 1
0
 /// <inheritdoc/>
 public virtual async Task <bool> TryCorrelateAsync(V1TryCorrelateWorkflowInstanceCommand command, CancellationToken cancellationToken = default)
 {
     if (command == null)
     {
         throw new ArgumentNullException(nameof(command));
     }
     return(await this.Mediator.ExecuteAndUnwrapAsync(this.Mapper.Map <Application.Commands.WorkflowInstances.V1TryCorrelateWorkflowInstanceCommand>(command), cancellationToken));
 }
        /// <inheritdoc/>
        public virtual async Task <bool> TryCorrelateAsync(V1TryCorrelateWorkflowInstanceCommand command, CancellationToken cancellationToken = default)
        {
            var result = await this.RuntimeApi.TryCorrelateAsync(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 !);
        }
Esempio n. 3
0
 /// <inheritdoc/>
 public virtual async Task <GrpcApiResult <bool> > TryCorrelateAsync(V1TryCorrelateWorkflowInstanceCommand command, CallContext context = default)
 {
     return(GrpcApiResult.CreateFor(await this.Mediator.ExecuteAsync(Mapper.Map <Application.Commands.WorkflowInstances.V1TryCorrelateWorkflowInstanceCommand>(command), context.CancellationToken)));
 }