public void updateCreditRequest() {
   LOG.info("updateCreditRequest");
   getCreditRequest().setState(CreditRequestState.Update);
   LOG.info(Data.encodeToXml(creditRequest));
   String requestId = creditApprovalProcess.process(creditRequest);
   creditRequest = contractManagement.getContract(requestId);
 }
 public void refuseCreditRequest() {
   LOG.info("refuseCreditRequest");
   getCreditRequest().setState(CreditRequestState.Delete);
   LOG.info(Data.encodeToXml(creditRequest));
   String ret = creditApprovalProcess.process(creditRequest);
   if (ret != null && ret.equals("success")) {
     FacesContext.getCurrentInstance()
         .addMessage(null, new FacesMessage("Refused credit request"));
     finalized = true;
   }
 }
  public String acceptOffer() {
    LOG.info("acceptOffer");
    LOG.info(Data.encodeToXml(creditRequest));
    getCreditRequest().setState(CreditRequestState.Accept);
    String ret = creditApprovalProcess.process(creditRequest);

    if (ret != null && ret.equals("success")) {
      FacesContext.getCurrentInstance()
          .getExternalContext()
          .getSessionMap()
          .put("shippingClient", creditApprovalProcess.getShippingClient());
      FacesContext.getCurrentInstance()
          .getExternalContext()
          .getSessionMap()
          .put("requestId", creditRequest.getRequestId());

      return "step_finalize.xhtml";
    }
    return "step_update.xhtml";
  }