Red Hat Training

A Red Hat training course is available for JBoss Enterprise SOA Platform

Chapter 4. An Introductory Tutorial

4.1. Running BPEL Processes on the JBoss Enterprise SOA Platform

Introduction

The "BPEL ESB Hello World" quickstart demonstrates how an ESB service can directly invoke a BPEL process, provided that:

  1. The BPEL engine and the ESB are located in the same JVM
  2. The invoked BPEL process is deployed to the BPEL engine instance running on the same ESB.

4.2. Deploy the "BPEL ESB Hello World" Quickstart

Procedure 4.1. Deploy the "BPEL ESB Hello World" Quickstart

  1. Check that the JBoss Enterprise SOA Platform server is running.
  2. Navigate to the directory containing the quickstarts: cd SOA_ROOT/samples/quickstarts/bpel_helloworld (or chdir SOA_ROOT\samples\quickstarts\bpel_helloworld in Microsoft Windows).
  3. Deploy the quickstart by running ant deploy.
  4. Execute the quickstart by running ant runtest.
Result

This command will send the text "Hello World via ESB to BPEL" to the ESB service, which will invoke the BPEL process. This in turn will append "Hello World" to the text and echo it back until it is received by the client application.

4.3. Quickstart

The quickstarts are sample projects. Each one demonstrates how to use a specific piece of functionality in order to aid you in building services. There are several dozen quickstarts included in the SOA_ROOT/jboss-as/samples/quickstarts/ directory. Build and deploy every quickstart by using Apache Ant.

4.4. ant deploy

ant deploy compiles a quickstart's source code in the build directory, then generates an .ESB file (such as Quickstart_helloworld.esb) in the server profile's deploy directory. (Note that it generates .JAR files for BPEL quickstarts.) The server detects the presence of the new .esb archive and deploys it. In the .ESB archive is a deployment.xml file that ant deploy uses to configure a queue.
ant deploy also uses an XSL template to transform generic JMS queue names into the specific JMS queues needed by the target server's messaging provider. Ant selects the correct messaging provider by examining the server for a messaging provider deployment. Only JBoss Messaging, JBoss MQ, and HornetQ are detected by the build script. Other messaging providers are not supported by the quick start. Ant then puts the deployment.xml file into the build/META-INF directory before including it in the same .ESB archive as the rest of the quickstart.

4.5. ant runtest

ant runtest sends an ESB-unaware "Hello World" message (which is a plain String object) to the JMS Queue (queue/quickstart_helloworld_Request_gw). It instructs Java to run the sender class (in the case of the "Hello World" quick start, this is called org.jboss.soa.esb.samples.quickstart.helloworld.test.sendJMSMessage). By doing so, it sends a message directly to the deployed process.