JBoss.orgCommunity Documentation
One of the stages within the architecture phase is to define the information model for the message types associated with the messages exchanges between the interacting participants.
This involves defining message schema for each example message. The schema could already exist and be reused, it could be based on existing schema and just need to be upgraded to support new requirements, or it may need to be defined from scratch.
An example of a schema associated with the purchasing model is the
store.xsd
shown here:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.jboss.org/examples/store"
xmlns:tns="http://www.jboss.org/examples/store"
elementFormDefault="qualified">
<element name="BuyRequest" type="tns:StoreType"></element>
<element name="BuyConfirmed" type="tns:StoreType"></element>
<element name="BuyFailed" type="tns:StoreType"></element>
<complexType name="StoreType">
<attribute name="id" type="string"></attribute>
</complexType>
</schema>
Once the schema has been defined, then the example messages need to be updated
to reference the schema, as shown in the following BuyRequest.xml
example message:
<tns:BuyRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tns="http://www.jboss.org/examples/store"
xsi:schemaLocation="http://www.jboss.org/examples/store store.xsd "
id="1" />
Once the association between example messages and the schema has been established, it is possible to validate the messages against the schema.
For information on how to use the validation capabilities within Eclipse, please read the Eclipse XML Validation Tutorial.
The next step in the development process is to specify a Choreography Model to implement the requirements described within the set of scenarios.
The current representation used to define Choreography Models within SAVARA is the W3C Web Service Choreography Description Language (WS-CDL). The pi4soa tools provide a WS-CDL (or choreography description) editor. Although this standard is associated with web services, it does not mean that a system specified using this standard needs to be implemented using web services. The actual WS-CDL language is used for defining the interactions between any distributed system.
The choreography description for the Purchasing example can be found in
purchasing/PurchaseGoods.cdm
. When the
choreography editor has been launched, by double-clicking on this file within the Eclipse
environment, then navigate to the Choreography Flows tab to see the
definition of the purchasing process:
The pi4soa tools can be used to test the scenarios against the choreography description, to
ensure that the choreography correctly implements the requirements. To test the
SuccessfulPurchase.scn
scenario against the choreography, launch
the scenario editor by double-clicking on the scenario file, and then pressing the
green play button in the toolbar. When complete, the scenario
should look like the following image, indicating that the scenario completed successfully.
To view a scenario that demonstrates a test failure, open the
InvalidPurchase.scn
scenario by double-clicking on the file, and
then initiate the test using the green play button in the toolbar.
When complete, the scenario should look like the following image.
You will notice that the Store participant has a red 'send' node, indicating that this action was not expected behaviour when compared with the choreography description. The reason this is considered an error, is that the Store participant should only send a BuyFailed message following an invalid credit check.
When an error is detected in a scenario, the choreography designer can then determine whether the scenario is wrong (i.e. it does not correctly describe a business requirement), or whether the choreography is wrong and needs to be updated to accomodate the scenario.
Once the choreography description has been successfully tested against the scenarios, the next step may be to obtain approval to proceed to the analysis/design phase. To help support this effort, the pi4soa tools provide the means to export the choreography description to a range of representations. HTML documentation generation is discussed below, and BPMN diagram generation is discussed in the Service Oriented Analysis and Design section.
To generate HTML documentation, select the Export->Other->HTML menu item associated with the choreography description file.
The next step is to provide the location and name of the HTML file to be generated.
If the HTML has been generated within the scope of Eclipse project, then refresh the relevant folder to show the file and open the file with the Eclipse web browser (as shown below). If outside the Eclipse project, then use a normal web browser to view the file.