Hello World BPEL Sample
======================================
This sample demonstrates an SCA service implemented by a BPEL process.
The README in the samples directory (the directory above this) provides
general instructions about building and running samples. Take a look there
first.
If you just want to run it to see what happens open a command prompt, navigate
to this sample directory, and do
ant compile run
OR if you don't have ant,
java -cp ../../modules/tuscany-assembly-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-assembly-xml-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-assembly-xsd-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-binding-sca-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-binding-sca-xml-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-contribution-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-contribution-impl-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-contribution-namespace-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-core-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-core-databinding-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-core-spi-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-databinding-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-databinding-jaxb-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-databinding-sdo-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-definitions-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-definitions-xml-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-domain-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-domain-api-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-host-embedded-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-implementation-bpel-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-implementation-java-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-implementation-java-runtime-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-implementation-java-xml-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-interface-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-interface-java-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-interface-java-xml-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-interface-wsdl-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-interface-wsdl-xml-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-node-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-node-api-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-policy-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-policy-logging-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-policy-xml-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-sca-api-1.1-incubating-SNAPSHOT.jar;../../modules/tuscany-wsdl2java-1.1-incubating-SNAPSHOT.jar;../../lib/XmlSchema-1.3.2.jar;../../lib/activation-1.1.jar;../../lib/activeio-2.0-r118.jar;../../lib/annogen-0.1.0.jar;../../lib/axiom-api-1.2.5.jar;../../lib/axiom-dom-1.2.5.jar;../../lib/axiom-impl-1.2.5.jar;../../lib/axion-1.0-M3-dev.jar;../../lib/axis2-adb-1.3.jar;../../lib/axis2-codegen-1.3.jar;../../lib/axis2-java2wsdl-1.3.jar;../../lib/axis2-kernel-1.3.jar;../../lib/backport-util-concurrent-2.2.jar;../../lib/cglib-nodep-2.1_3.jar;../../lib/codegen-2.2.3.jar;../../lib/codegen-ecore-2.2.3.jar;../../lib/common-2.2.3.jar;../../lib/commons-codec-1.3.jar;../../lib/commons-collections-3.1.jar;../../lib/commons-fileupload-1.1.1.jar;../../lib/commons-httpclient-3.0.1.jar;../../lib/commons-io-1.2.jar;../../lib/commons-jexl-1.1.jar;../../lib/commons-lang-2.1.jar;../../lib/commons-logging-1.1.jar;../../lib/commons-primitives-1.0.jar;../../lib/derby-10.1.3.1.jar;../../lib/ecore-2.2.3.jar;../../lib/ecore-change-2.2.3.jar;../../lib/ecore-xmi-2.2.3.jar;../../lib/geronimo-activation_1.1_spec-1.0-M1.jar;../../lib/geronimo-common-1.2-beta.jar;../../lib/geronimo-commonj_1.1_spec-1.0.jar;../../lib/geronimo-connector-1.2-beta.jar;../../lib/geronimo-core-1.2-beta.jar;../../lib/geronimo-deployment-1.2-beta.jar;../../lib/geronimo-ejb_3.0_spec-1.0.jar;../../lib/geronimo-interceptor-1.2-beta.jar;../../lib/geronimo-j2ee-1.2-beta.jar;../../lib/geronimo-j2ee-connector_1.5_spec-1.1.jar;../../lib/geronimo-j2ee-jacc_1.0_spec-1.1.jar;../../lib/geronimo-j2ee-management_1.0_spec-1.1.jar;../../lib/geronimo-javamail_1.4_spec-1.0-M1.jar;../../lib/geronimo-jms_1.1_spec-1.1.jar;../../lib/geronimo-jpa_3.0_spec-1.0.jar;../../lib/geronimo-jta_1.0.1B_spec-1.0.jar;../../lib/geronimo-kernel-1.2-beta.jar;../../lib/geronimo-management-1.2-beta.jar;../../lib/geronimo-naming-1.2-beta.jar;../../lib/geronimo-spec-j2ee-connector-1.5-rc4.jar;../../lib/geronimo-spec-jta-1.0.1B-rc4.jar;../../lib/geronimo-system-1.2-beta.jar;../../lib/geronimo-transaction-1.2-beta.jar;../../lib/geronimo-util-1.2-beta.jar;../../lib/howl-1.0.1-1.jar;../../lib/httpcore-4.0-alpha5.jar;../../lib/httpcore-nio-4.0-alpha5.jar;../../lib/httpcore-niossl-4.0-alpha5.jar;../../lib/javacc-3.2.jar;../../lib/jaxb-api-2.1.jar;../../lib/jaxb-impl-2.1.5.jar;../../lib/jaxb-xjc-2.1.4.jar;../../lib/jaxb2-reflection-2.1.4.jar;../../lib/jaxen-1.1-beta-9.jar;../../lib/jaxws-api-2.1.jar;../../lib/jsr181-api-1.0-MR1.jar;../../lib/jsr250-api-1.0.jar;../../lib/log4j-1.2.12.jar;../../lib/logkit-1.0.1.jar;../../lib/mail-1.4.jar;../../lib/neethi-2.0.2.jar;../../lib/ode-bpel-api-1.1.jar;../../lib/ode-bpel-compiler-1.1.jar;../../lib/ode-bpel-dao-1.1.jar;../../lib/ode-bpel-epr-1.1.jar;../../lib/ode-bpel-obj-1.1.jar;../../lib/ode-bpel-runtime-1.1.jar;../../lib/ode-bpel-schemas-1.1.jar;../../lib/ode-bpel-store-1.1.jar;../../lib/ode-dao-jpa-1.1.jar;../../lib/ode-jacob-1.1.jar;../../lib/ode-jacob-ap-1.1.jar;../../lib/ode-scheduler-simple-1.1.jar;../../lib/ode-utils-1.1.jar;../../lib/openjpa-all-0.9.7-incubating.jar;../../lib/openjpa-persistence-0.9.7-incubating.jar;../../lib/regexp-1.3.jar;../../lib/saaj-api-1.3.jar;../../lib/saxon-8.7.jar;../../lib/saxon-dom-8.7.jar;../../lib/saxon-xpath-8.7.jar;../../lib/serp-1.12.0.jar;../../lib/stax-api-1.0-2.jar;../../lib/tranql-connector-1.1.jar;../../lib/tuscany-sdo-api-r2.1-1.0-incubating.jar;../../lib/tuscany-sdo-impl-1.0-incubating.jar;../../lib/tuscany-sdo-lib-1.0-incubating.jar;../../lib/tuscany-sdo-tools-1.0-incubating.jar;../../lib/woden-1.0-incubating-M7b.jar;../../lib/wsdl4j-1.6.2.jar;../../lib/wstx-asl-3.2.1.jar;../../lib/xalan-2.7.0.jar;../../lib/xbean-naming-2.7.jar;../../lib/xercesImpl-2.8.1.jar;../../lib/xml-apis-1.3.03.jar;../../lib/xml-resolver-1.1.jar;../../lib/xmlbeans-2.3.0.jar;../../lib/xsd-2.2.3.jar;target/classes;target/database helloworld.BPELClient
The sample will start the an embedded BPEL engine, deploy process and invoke it.
Sample Overview
---------------
The sample provides a single component that is wired to a service with a
web service binding.
helloworld-bpel/
src/
main/
java/
helloworld/
BPELClient.java - client application for
BEPELHelloWorldComponent
resources/
deploy.xml - ODE deployment descriptor
helloworld.bpel - helloworld bpel process
helloworld.componentType - helloworld bpel service description
helloworld.composite - the SCA assembly for this sample
helloworld.wsdl - the service description that describes
the bpel process
log4j.properties - logging configuration
test/
java/
helloworld/
BPELHelloWorldTestCase.java - JUnit test case
helloworld-bpel.png - a pictorial representation of the
sample .composite file
build.xml - the Ant build file
pom.xml - the Maven build file
Building And Running The Sample Using Ant
-----------------------------------------
With the binary distribution the sample can be built and run using Ant as
follows
cd helloworld-bpel
ant compile
ant run
Building And Running The Sample Using Maven
-------------------------------------------
With either the binary or source distributions the sample can be built and run
using Maven as follows. When using Maven, a simple test is present that exercise
the same logic as the client to invoke the BPEl process.
cd helloworld-bpel
mvn
You should see the following output from the test phase.
-
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running helloworld.BPELHelloWorldTestCase
Starting BPELHelloWorldComponent org.apache.tuscany.sca.core.assembly.RuntimeComponentImpl
INFO - GeronimoLog.info(79) | BPEL Server Started.
10:19:31,609 INFO [BpelServerImpl] BPEL Server Started.
Deploying : D:\dev\Opensource\Apache\Tuscany\source\java\sca\samples\helloworld-bpel\target\classes
D:\dev\Opensource\Apache\Tuscany\source\java\sca\samples\helloworld-bpel\target\classes
INFO - GeronimoLog.info(79) | Process {http://tuscany.apache.org/implementation/bpel/example/helloworld}HelloWorld-1 has been unregistered.
10:19:37,656 INFO [BpelServerImpl] Process {http://tuscany.apache.org/implementation/bpel/example/helloworld}HelloWorld-1 has been unregistered.
INFO - GeronimoLog.info(79) | Activated process {http://tuscany.apache.org/implementation/bpel/example/helloworld}HelloWorld-1.
10:19:38,312 INFO [BpelServerImpl] Activated process {http://tuscany.apache.org/implementation/bpel/example/helloworld}HelloWorld-1.
INFO - GeronimoLog.info(79) | Process {http://tuscany.apache.org/implementation/bpel/example/helloworld}HelloWorld-1 has been unregistered.
10:19:38,312 INFO [BpelServerImpl] Process {http://tuscany.apache.org/implementation/bpel/example/helloworld}HelloWorld-1 has been unregistered.
INFO - GeronimoLog.info(79) | Activated process {http://tuscany.apache.org/implementation/bpel/example/helloworld}HelloWorld-1.
10:19:38,453 INFO [BpelServerImpl] Activated process {http://tuscany.apache.org/implementation/bpel/example/helloworld}HelloWorld-1.
::message::
Status: RESPONSE
Response:
World
Stopping BPELHelloWorldComponent org.apache.tuscany.sca.core.assembly.RuntimeComponentImpl
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 18.031 sec
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] [jar:jar]
[INFO] Building jar: D:\dev\Opensource\Apache\Tuscany\source\java\sca\samples\helloworld-bpel\target\sample-helloworld-bpel.jar
[INFO] [install:install]
[INFO] Installing D:\dev\Opensource\Apache\Tuscany\source\java\sca\samples\helloworld-bpel\target\sample-helloworld-bpel.jar to C:\Documents and Settings\lresende\.m
2\repository\org\apache\tuscany\sca\sample-helloworld-bpel\1.1-incubating-SNAPSHOT\sample-helloworld-bpel-1.1-incubating-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 3 seconds
[INFO] Finished at: Tue Sep 18 10:19:41 PDT 2007
[INFO] Final Memory: 24M/46M
[INFO] ------------------------------------------------------------------------
This shows that the Junit test cases have run successfully.