{
Object[] parameters = cycle.getServiceParameters();
Integer bookPK = (Integer) parameters[0];
Visit visit = (Visit) getPage().getVisit();
Home home = (Home) cycle.getPage("Home");
VirtualLibraryEngine vengine = (VirtualLibraryEngine) cycle.getEngine();
int i = 0;
while (true)
{
try
{
IOperations bean = vengine.getOperations();
Book book = bean.borrowBook(bookPK, visit.getUserId());
home.setMessage("Borrowed: " + book.getTitle());
break;
}
catch (BorrowException ex)
{