JBoss.orgCommunity Documentation

Chapter 2. CDL Validator

2.1. Trailblazer Example

This example can be found in the trailblazer folder, which contains an enhanced version of the trailblazer example found in the JBossESB distribution. See the TrailBlazer Guide in the JBossESB distribution ($JBossESB/docs/samples/TBGuide.pdf) for more information about the example. The main changes are the introduction of a File Based Bank, and modifications to the message structures to enable a consistent conversation id to be carried with the messages.

  1. Update the $JBossAS/server/default/deploy/jbossesb.sar/jbossesb-properties.xml file, in the section entitled "transports" and specify all of the SMTP mail server settings for your environment.
  2. Update the trailblazer/trailblazer.properties

    Update the file.bank.monitored.directory and file.output.directory properties. These are folders used by the File Based Bank, and are set to /tmp/input and /tmp/output by default.

  3. Update the trailblazer/esb/conf/jboss-esb.xml

    There is a fs-provider block, update the directory attribute value to be the same as the file.output.directory value in trailblazer.properties file.

  4. Start the JBossAS server
  5. From the trailblazer folder, execute the command to start the ESB: ant deploy

    this should deploy the ESB and WAR files to your JBoss AS server/default.

  6. From the trailblazer/banks folder, execute the command to start the JMS Bank service: ant runJMSBank.
  7. From the trailblazer/banks folder, execute the command to start the JMS Bank service: ant runFileBank.
  8. In the Eclipse environment, select the popup menu associated with the trailblazer.cdm file, and choose the Choreography->Monitor menu item.

    Wait for the monitor window to start, and indicate that the choreography is being monitored, shown in the status line at the bottom of the window.

  9. Start a browser and enter the URL: localhost:8080/trailblazer.

  10. Now you can submit quotes, You will see either a loan request rejected (single email) because the score is less than 4, or two emails (one from JMS bank and one from FileBased bank) with valid quotes. When entering subsequent quotes, make sure that the quote reference is updated, so that each session has a unique id.

To demonstrate what occurs when the implementation deviates from the expected behaviour as defined in the choreography description, try the following steps:

  1. Run the ant task ant deploy-error-client to redeploy the trailblaizer example.
  2. Run the commands from step 6 above.

The above steps show how changing the service implementation without updating a choreography can result in behavioural validation errors being detected.

What is changed when we run ant deploy-error-client

Compared to command of ant deploy, basically, we have just updated the following code in $Overlord/samples/trailblazer/client/src/org/jboss/soa/esb/samples/trailblazer/loanbroker/LoanBroker.java file.

In the following code within the processLoanRequest method, we've changed the "4" to "7"

        //step 2 - check if score is acceptable        
        if (score >= 4) {

Issue further loan requests, remembering to change the quote reference each time, until a Credit Check result of between 4 and 6 inclusive occurs, which will result in an out of sequence message being reported (in red) to the Choreography Monitor

Note

It is currently a requirement that the choreography used within the Choreography Monitor is the same as the description used to locally monitor the services (i.e. within the overlord-cdl-validator.esb/models directory).