public ActionResult Reject(string id) { var command = new RejectClaimRequest { ClaimRequestId = id, Reason = "Rejected by EFO claims operative." }; try { var response = _commandSender.Send(command); if (response.CommandStatus == CommandStatusEnum.Failed) { ModelState.AddModelError("ResponseError", response.Message); } return(RedirectToAction("Index")); } catch (TimeoutException toe) { ModelState.AddModelError("TimeOutError", toe.Message); return(RedirectToAction("Index")); } catch (Exception ex) { ModelState.AddModelError("Error", ex.Message); return(RedirectToAction("Index")); } }
private void Handle(TimeoutExpired timeOutEvent) { //send a RejectClaimRequest command to the bus var reject = new RejectClaimRequest { ClaimRequestId = timeOutEvent.CorrelationId.ToString(), Reason = string.Format("Rejected because the participant did not substantiate the claim within the time allowed.") }; Bus.Publish(reject); }
public void RejectClaimRequest(RejectClaimRequest command) { if (_state.CurrentClaimState == ClaimRequestStateEnum.PendingSubstantiation) { RaiseClaimRequestRejectedEvent(command.ClaimRequestId, command.Reason); } else { throw new DomainException( string.Format( "Received a command to reject this card use, but this claim request is not in a state [{0}] to process that command.", _state.CurrentClaimState)); } }
public void Consume(RejectClaimRequest message) { _claimRejected.Set(); }