Exemplo n.º 1
0
  public void bookHotel() {
    booking = new Booking(hotelSelection, user, 7, 2);
    hotelSelection = null;

    // for demo convenience
    booking.setCreditCardNumber("1111222233334444");
    log.bookingInitiated(user.getName(), booking.getHotel().getName());

    messages
        .info(new DefaultBundleKey("booking_initiated"))
        .defaults("You've initiated a booking at the {0}.")
        .params(booking.getHotel().getName());
  }
Exemplo n.º 2
0
  @Begin
  public void selectHotel(final Long id) {
    conversation.setTimeout(600000); // 10 * 60 * 1000 (10 minutes)

    // NOTE get a fresh reference that's managed by the extended persistence context
    hotelSelection = em.find(Hotel.class, id);
    if (hotelSelection != null) {
      log.hotelSelected(
          user != null ? user.getName() : "Anonymous",
          hotelSelection.getName(),
          hotelSelection.getCity());
    }
  }