public override async Task <ProcessWFClientActionResponse> ExecuteAsync(ProcessWFClientActionRequest request, CancellationToken cancellationToken) { Request = request; foreach (var i in request.Items) { await ProcessAsync(i); } return(new ProcessWFClientActionResponse { Items = request.Items }); async Task ProcessAsync(WorkflowAction action) { var withdrawal = await _service.GetWithdrawal(action.WithdrawalId, cancellationToken); if (string.IsNullOrWhiteSpace(withdrawal.WorkflowUrl)) { return; } await _service.UpdateWfUrlAsync(withdrawal.Id, string.Empty, cancellationToken); await _workflow.SendClientEventAsync(withdrawal.WorkflowUrl, action.Payload, cancellationToken); action.Succeeded = true; } }
public override async Task <UpdateClientEventResponse> ExecuteAsync(UpdateClientEventRequest request, CancellationToken cancellationToken) { Request = request; var result = await _service.UpdateWfUrlAsync(request.WithdrawalId, request.WorkflowUrl, cancellationToken); Response = new UpdateClientEventResponse { IsSuccessful = result }; return(Response); }