<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<!--
JBoss, Home of Professional Open Source
Copyright 2007, Red Hat Middleware LLC, and individual contributors
as indicated by the @author tags.
See the copyright.txt in the distribution for a full listing
of individual contributors.
This copyrighted material is made available to anyone wishing to use,
modify, copy, or redistribute it subject to the terms and conditions
of the GNU General Public License, v. 2.0.
This program is distributed in the hope that it will be useful, but WITHOUT A
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License,
v. 2.0 along with this distribution; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA  02110-1301, USA.

(C) 2007,
@author JBoss Inc.
-->

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Business Activity Framework Demo Application</title>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-2">
    <meta http-equiv="content-language" content="en">
    <meta name="author" content="Maciej Machulak">
    <link rel="stylesheet" type="text/css" href="green.css"/>
</head>
<body>

<div id="main">

<div id="headerLeft">
    <h1>Business Activity Framework Demo Application</h1>
</div>

<div id="headerRight">
    <img src="jboss.jpg">
</div>

<div id="headerBottom">
    Debug window (service return value):
</div>

<div id="headerDebug">
    ${requestScope.DEBUG}
</div>

${requestScope.ACTIVE}

<div id="menu">
    <p>
        <a href="HotelService?page=index.jsp">Home</a><br>
        <a href="HotelService?page=about.jsp">About Demo Application</a><br>
        <a href="HotelService?page=author.jsp">About Author</a><br>
    </p>
    <hr>
    <p>
        <a href="HotelService?page=initialise.jsp" ${requestScope.INITIALISE}>Initialise data</a><br>
        <a href="HotelService?method=dropHotelData&baRequest=false" ${requestScope.DROP}>Delete data</a><br>
        <a href="HotelService?method=getHotelData&baRequest=false" ${requestScope.SHOW}>Show data</a><br>
    </p>
    <hr>
    <p>
        <a href="HotelService?method=startBA&baRequest=true" ${requestScope.BEGIN}>Begin Business Activity</a><br>
    </p>
    <hr>
    <p>
        <b>BA services:</b><br>
        <a href="HotelService?page=hotelinfo.jsp" ${requestScope.BASERVICE}>Hotel Info</a><br>
        <a href="HotelService?page=bookroom.jsp" ${requestScope.BASERVICE}>Book Room</a><br>
        <a href="HotelService?page=getpackage.jsp" ${requestScope.BASERVICE}>Get Package</a><br>
        <a href="HotelService?page=bookfitness.jsp" ${requestScope.BASERVICE}>Book Fitness</a><br>
        <a href="HotelService?page=bookcasino.jsp" ${requestScope.BASERVICE}>Book Casino</a><br>
        <a href="HotelService?page=ordermeal.jsp" ${requestScope.BASERVICE}>Order Meal</a><br>
        <a href="HotelService?page=increaserating.jsp" ${requestScope.BASERVICE}>Increase Rating</a><br>
        <a href="HotelService?page=decreaserating.jsp" ${requestScope.BASERVICE}>Decrease Rating</a><br>
    </p>
    <hr>
    <p>
        <a href="HotelService?method=closeBA&baRequest=true" ${requestScope.CLOSE}>Close Business Activity</a><br>
        <a href="HotelService?method=cancelBA&baRequest=true" ${requestScope.CANCEL}>Cancel Business Activity</a><br>
    </p>
    <hr>
    <p>
        <b>Normal services:</b><br>
        <a href="HotelService?page=cancelroom.jsp" ${requestScope.SERVICE}>Cancel Room</a><br>
        <a href="HotelService?page=cancelpackage.jsp" ${requestScope.SERVICE}>Cancel Package</a><br>
        <a href="HotelService?page=cancelfitness.jsp" ${requestScope.SERVICE}>Cancel Fitness</a><br>
        <a href="HotelService?page=cancelcasino.jsp" ${requestScope.SERVICE}>Cancel Casino</a><br>
        <a href="HotelService?page=cancelmeal.jsp" ${requestScope.SERVICE}>Cancel Meal</a><br>
    </p>
    <hr>
</div>











<div id="body" align=center>

<p align="center">
<h1>Business Activity Framework Demo Application</h1>
<h2>Help page</h2>
<p align="left">
    <b>Concept</b><br>
    This is a simple Web-based demo application for the novel Business Activity framework. It helps with
    understanding the basic concepts of using framework's API - metadata and additional operations which
    increase the frameworks flexibility. For more information about the design of the framework and a more
    detailed description of its API please consider documents located on the framework's website at:
    <br><a href="http://labs.jboss.com/jbosstm/baframework/index.html">http://labs.jboss.com/jbosstm/baframework/index.html</a>
    .<br>This website also includes a forum where all questions regarding framework's design or usage are welcome.
    <br>
    <br>
    If no previous experience with extended transactions or Transactional Web Services is possesed, it is
    strongly adviced to familiarise with materials presented in the <b>References</b> section on this page.
    Mostly [1] and [2] are recommended.
</p>
<p align="left">
    <b>Usage</b><br>
    To start using the demo application it is necessary to perform following steps:
    <ul>
        <li>Initialise data on the server -> <a href="HotelService?page=initialise.jsp">click here</a>
        <li>Start the Business Activity -> <a href="HotelService?method=startBA&baRequest=true">click here</a>
        <li>Use any of provided BA Services
        <li>End the Business Activity - by either <a href="HotelService?method=closeBA&baRequest=true">completing</a> or <a href="HotelService?method=cancelBA&baRequest=true">cancelling</a> the work.
    </ul>
</p>
<p align="left">
    <b>BA-related code</b>
    <br>
    All services are implemented as methods of a stateless session bean (HotelImpl class) accessible through a remote interface (Hotel class)
    and exposed as Web Services using the JSR-181 annotations. The HotelImpl class is annotated with the BACompensation annotation to provide
    common information related to compensation actions.
</p>
<p>
    <div id="code">
<pre>
//...<br>
<span class="annotation">@BACompensation</span>(serviceClass=<span class="id">HotelImpl.class</span>,<br>
&#09;ejbInterface=<span class="id">Hotel.class</span>,<br>
&#09;jndiName="<span class="id">bademo/HotelImpl/remote</span>")<br>
public class HotelBAImpl implements HotelBA<br>
{
&#09;//...<br>
}
</pre>
    </div>
</p>
<p align="left">
    Some methods that are exposed as Web Services make use of the Compensation Manager component provided by the Business Activity framework as shown in the code below.
</p>
<p>
    <div id="code">

<pre>
//...<br>
public class HotelBAImpl implements HotelBA<br>
{
&#09;//...<br>
&#09;<span class="annotation">@BACompensationManagement</span><br>
&#09;<span class="id">CompensationManager</span> cm;<br>
&#09;//...<br>
}
</pre>
    </div>

</p>
<p align="left">
    Some services may be used only within a scope of a Business Activity (BA services). Others may be use outside the Business Activity (Normal services) - they are however defined as compensation actions of the BA services.. These
    services may be used to test behaviour of compensation mechanisms in case Isolation of service execution is not preserved - i.e.
    a order has been cancelled outside the scope of a transaction).
</p>

<p align="left">
    Although description of each single method has been provided it is strongly adviced that users examine the source
    code of Web Services when performing tests. Moreover, annotations on method descriptions have most of their member values
    explicitly specified for learning purposes only. Because designed annotations have intuitive and reasonable default values already specified,
    the actual code is less complex.
</p>

<p align="left">
    <b>Web Services</b><br>
    Business Activity Framework Demo Application consists of a set of Web Services that represents common
    usage of the framework's API so that it is possible to gain knowledge about all designed annotations
    and operations.<br>

</p>
<p align="left">
    <b>References</b><br>
    Following is the list of references which is worth considering when learning about Transactional Web Services (to be updated shortly):
    <ul>
        <li>[1] Little, M., J. Maron, and G. Pavlik, Java Transaction Processing: Design and Implementation, Prentice Hall PTR, New Jersey, USA, 2004.
        <li>[2] WS-BusinessActivity Specification, version 1.0. August 2005.  http://www.arjuna.com/library/specs/ws-tx/WS-BusinessActivity.pdf.

    </ul>
</p>
<p align="left">
    <b>Questions</b><br>
    Any questions related to the test application or the framework can be directed to the author at
    <a href="mailto:mmachulak-at-redhat.com">mmachulak-at-redhat.com</a>. All constructive remarks are highly appreciated.
</p>

</p>


</div>

<div id="footer">
    <p align=right>
        &copy; JBoss, a division of Red Hat
    </p>
</div>

</div>

</body>
</html>