Example #1
0
 /// <inheritdoc/>
 public virtual async Task SetCorrelationMappingAsync(V1SetWorkflowInstanceCorrelationMappingCommand command, CancellationToken cancellationToken = default)
 {
     if (command == null)
     {
         throw new ArgumentNullException(nameof(command));
     }
     await this.Mediator.ExecuteAndUnwrapAsync(this.Mapper.Map <Application.Commands.WorkflowInstances.V1SetWorkflowInstanceCorrelationMappingCommand>(command), cancellationToken);
 }
        /// <inheritdoc/>
        public virtual async Task SetCorrelationMappingAsync(V1SetWorkflowInstanceCorrelationMappingCommand command, CancellationToken cancellationToken = default)
        {
            var result = await this.RuntimeApi.SetCorrelationMappingAsync(command, cancellationToken);

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