*/
private void testBusinessActivity(int restaurantSeats, int theatreSeats, int theatreArea, boolean bookTaxi) throws Exception
{
System.out.println("CLIENT: obtaining userBusinessActivity...");
UserBusinessActivity uba = UserBusinessActivityFactory.userBusinessActivity();
System.out.println("CLIENT: starting the transaction...");
uba.begin();
System.out.println("CLIENT: transaction ID= " + uba.toString());
System.out.println("CLIENT: calling business Web Services...");
boolean isOK = false ;
try
{
if (restaurantBA.bookSeats(restaurantSeats) && theatreBA.bookSeats(theatreSeats, theatreArea))
{
isOK = !bookTaxi || taxiBA.bookTaxi() ;
}
}
catch (final Throwable th)
{
System.out.println("CLIENT: caught exception processing bookings, cancelling (" + th.getMessage() + ")") ;
}
if (isOK)
{
System.out.println("CLIENT: all OK");
System.out.println("CLIENT: calling close on the transaction...");
uba.close();
}
else
{
System.out.println("CLIENT: one or more services failed, calling cancel.");
uba.cancel();
}
System.out.println("CLIENT: done.");
System.out.flush();
}