| 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 run |
| |
| OR if you don't have ant, on Windows do |
| |
| unzip ..\..\lib\ode-dao-jpa-ojpa-derby-1.1.zip -d target\database |
| unzip target\sample-helloworld-bpel.jar -d target\classes |
| java -cp ..\..\lib\tuscany-sca-manifest.jar;target\classes;target\database helloworld.BPELClient |
| |
| and on *nix do |
| |
| unzip ../../lib/ode-dao-jpa-ojpa-derby-1.1.zip -d target/database |
| unzip target/sample-helloworld-bpel.jar -d target/classes |
| java -cp ../../lib/tuscany-sca-manifest.jar:target/classes:target/database helloworld.BPELClient |
| |
| The sample will start an embedded BPEL engine, deploy a process and invoke it. |
| |
| Unlike other samples that are run from a jar file, this sample is run from the |
| target/classes directory because Tuscany doesn't currently support running |
| a BPEL process file contained within a jar (see TUSCANY-1994). |
| |
| 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 |
| |
| |
| You should see the following output from the run target. |
| |
| run: |
| [java] Starting BPELHelloWorldComponent |
| [java] >>> Deploying : D:\temp\SCA1.1-RC1\tuscany-sca-1.1-incubating\samples\helloworld-bpel\target\classes |
| [java] ::arg:::::: <?xml version="1.0" encoding="UTF-8"?> |
| [java] <hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"><message xmlns="http://tuscany.apache.org/implementation/bpel/exampl |
| e/helloworld.wsdl">Hello</message></hello> |
| [java] ::message:: <?xml version="1.0" encoding="UTF-8"?> |
| [java] <message><TestPart><hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"><message xmlns="http://tuscany.apache.org/impleme |
| ntation/bpel/example/helloworld.wsdl">Hello</message></hello></TestPart></message> |
| [java] Status: RESPONSE |
| [java] Response: <?xml version="1.0" encoding="UTF-8"?> |
| [java] <message><TestPart><hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl">Hello World</hello></TestPart></message> |
| [java] Hello World |
| [java] Stopping BPELHelloWorldComponent |
| [java] Stopped !!! |
| |
| BUILD SUCCESSFUL |
| Total time: 36 seconds |
| |
| 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 exercises |
| 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 |
| >>> Deploying : D:\dev\Opensource\Apache\Tuscany\source\java-sca-1.1\samples\helloworld-bpel\target\classes |
| ::arg:::::: <?xml version="1.0" encoding="UTF-8"?> |
| <hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"><message xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld |
| .wsdl">Hello</message></hello> |
| ::message:: <?xml version="1.0" encoding="UTF-8"?> |
| <message><TestPart><hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl"><message xmlns="http://tuscany.apache.org/implementation/bpel |
| /example/helloworld.wsdl">Hello</message></hello></TestPart></message> |
| Status: RESPONSE |
| Response: <?xml version="1.0" encoding="UTF-8"?> |
| <message><TestPart><hello xmlns="http://tuscany.apache.org/implementation/bpel/example/helloworld.wsdl">Hello World</hello></TestPart></message> |
| Stopping BPELHelloWorldComponent |
| Stopped !!! |
| Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 18.656 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-1.1\samples\helloworld-bpel\target\sample-helloworld-bpel.jar |
| [INFO] [install:install] |
| [INFO] Installing D:\dev\Opensource\Apache\Tuscany\source\java-sca-1.1\samples\helloworld-bpel\target\sample-helloworld-bpel.jar to C:\Documents and Settings\lresend |
| e\.m2\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: 53 seconds |
| [INFO] Finished at: Sun Jan 13 09:54:39 PST 2008 |
| [INFO] Final Memory: 24M/43M |
| [INFO] ------------------------------------------------------------------------ |
| |
| |
| This shows that the Junit test cases have run successfully. |