You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2011/04/19 16:17:46 UTC

svn commit: r1095098 - in /tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel: ./ src/main/java/ src/main/resources/ src/test/java/sample/

Author: antelder
Date: Tue Apr 19 14:17:46 2011
New Revision: 1095098

URL: http://svn.apache.org/viewvc?rev=1095098&view=rev
Log:
Add helloworld sample using BPEL. This doesn't work yet, looks like the is some issue with the imml bpel module/ode as it complains about the bpwl script url which looks ok to me

Added:
    tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/
      - copied from r1095081, tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-spring/
    tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/main/resources/helloworld.bpel
    tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/main/resources/helloworld.wsdl
    tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/test/java/sample/Helloworld.java
Removed:
    tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/main/java/
    tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/main/resources/helloworld-context.xml
Modified:
    tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/pom.xml
    tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/main/resources/helloworld.composite

Modified: tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/pom.xml?rev=1095098&r1=1095081&r2=1095098&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/pom.xml (original)
+++ tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/pom.xml Tue Apr 19 14:17:46 2011
@@ -27,10 +27,12 @@
       <version>2.0-SNAPSHOT</version>
       <relativePath>../../pom.xml</relativePath>
    </parent>
-   <artifactId>helloworld-spring</artifactId>
+
+   <packaging>zip</packaging>
+   <artifactId>helloworld-bpel</artifactId>
    <version>2.0-SNAPSHOT</version>
 
-   <name>Apache Tuscany SCA Samples Helloworld Spring</name>
+   <name>Apache Tuscany SCA Samples Helloworld BPEL</name>
 
    <properties>
       <tuscany.version>${project.version}</tuscany.version>
@@ -39,13 +41,6 @@
    <dependencies>
 
       <dependency>
-         <groupId>org.apache.tuscany.sca</groupId>
-         <artifactId>tuscany-sca-api</artifactId>
-         <version>${tuscany.version}</version>
-         <scope>provided</scope>
-      </dependency>
-
-      <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>4.8.1</version>
@@ -61,7 +56,7 @@
 
       <dependency>
          <groupId>org.apache.tuscany.sca</groupId>
-         <artifactId>tuscany-implementation-spring-runtime</artifactId>
+         <artifactId>tuscany-implementation-bpel-runtime</artifactId>
          <version>${tuscany.version}</version>
          <scope>test</scope>
       </dependency>
@@ -72,6 +67,14 @@
 
       <plugins>
 
+         <!-- to support zip packaging -->
+         <plugin>
+            <groupId>org.apache.tuscany.maven.plugins</groupId>
+            <artifactId>maven-zip-plugin</artifactId>
+            <version>alpha2</version>
+            <extensions>true</extensions>
+         </plugin>
+
          <!-- to support running the composite with mvn tuscany:run -->
          <plugin>
             <groupId>org.apache.tuscany.maven.plugins</groupId>
@@ -80,7 +83,7 @@
             <dependencies>
                <dependency>
                   <groupId>org.apache.tuscany.sca</groupId>
-                  <artifactId>tuscany-implementation-spring-runtime</artifactId>
+                  <artifactId>tuscany-implementation-bpel-runtime</artifactId>
                   <version>${tuscany.version}</version>
                </dependency>
             </dependencies>

Added: tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/main/resources/helloworld.bpel
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/main/resources/helloworld.bpel?rev=1095098&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/main/resources/helloworld.bpel (added)
+++ tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/main/resources/helloworld.bpel Tue Apr 19 14:17:46 2011
@@ -0,0 +1,80 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<process name="HelloWorld"
+    targetNamespace="http://tuscany.apache.org/implementation/bpel/example/helloworld"
+    xmlns="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
+    xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
+    xmlns:tns="http://tuscany.apache.org/implementation/bpel/example/helloworld"    
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:test="http://testing/"
+    queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
+    expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0" xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+
+  <import location="helloworld.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"
+     namespace="http://testing/"/>
+
+   <partnerLinks>
+      <partnerLink name="helloPartnerLink" partnerLinkType="test:HelloPartnerLinkType" myRole="me" />
+   </partnerLinks>
+    
+   <variables>
+     <variable name="helloMessage" messageType="test:HelloMessage"/>
+     <variable name="helloMessageResponse" messageType="test:HelloMessageResponse"/>
+     <variable name="tmpVar" type="xsd:string"/>
+   </variables>
+
+   <sequence>
+       <receive
+          name="start"
+          partnerLink="helloPartnerLink"
+          portType="test:HelloPortType"
+          operation="hello"
+          variable="helloMessage"
+          createInstance="yes"/>
+
+      <assign name="assign1">
+          <copy>
+              <!-- from>concat($helloMessage.TestPart/test:message/text(), ' World')</from -->
+              <from>concat($helloMessage.TestPart/test:arg0/text(), ' World')</from>
+              <!-- from>concat('Hello ', 'world')</from -->
+              <to variable="tmpVar"/>
+          </copy>
+          <!-- Initialize the response -->
+          <copy>
+              <from>
+                  <literal>
+                      <test:helloResponse>
+                          <test:messageResponse>Dummy</test:messageResponse>
+                      </test:helloResponse>
+                  </literal>        
+              </from>
+              <to variable="helloMessageResponse" part="TestResponse"/>
+          </copy>                  
+          <copy>
+              <from variable="tmpVar"/>
+              <to>$helloMessageResponse.TestResponse/test:messageResponse</to>
+          </copy>
+      </assign>
+       <reply name="end"  
+              partnerLink="helloPartnerLink"
+              portType="test:HelloPortType" 
+              operation="hello"
+              variable="helloMessageResponse"/>
+   </sequence>
+</process>

Modified: tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/main/resources/helloworld.composite
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/main/resources/helloworld.composite?rev=1095098&r1=1095081&r2=1095098&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/main/resources/helloworld.composite (original)
+++ tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/main/resources/helloworld.composite Tue Apr 19 14:17:46 2011
@@ -20,10 +20,11 @@
 <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
            xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1"
            targetNamespace="http://sample"
+xmlns:hns="http://tuscany.apache.org/implementation/bpel/example/helloworld"
            name="helloworld-contribution">
 
     <component name="HelloworldComponent">
-       <implementation.spring location="helloworld-context.xml"/>
+       <implementation.bpel process="hns:HelloWorld"/>
     </component>
 
 </composite>

Added: tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/main/resources/helloworld.wsdl
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/main/resources/helloworld.wsdl?rev=1095098&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/main/resources/helloworld.wsdl (added)
+++ tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/main/resources/helloworld.wsdl Tue Apr 19 14:17:46 2011
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~    http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<wsdl:definitions name="helloworld"
+    targetNamespace="http://testing/"
+    xmlns="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:tns="http://testing/"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+    xmlns:bpws="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
+    xmlns:plnk="http://schemas.xmlsoap.org/ws/2004/03/partner-link/">
+    
+    <wsdl:types>
+        <schema elementFormDefault="qualified" 
+           targetNamespace="http://testing/" 
+           xmlns="http://www.w3.org/2001/XMLSchema">
+
+            <element name="hello">
+                <complexType>
+                    <sequence>
+                        <element name="message" type="xsd:string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            
+            <element name="helloResponse">
+                <complexType>
+                    <sequence>
+                        <element name="messageResponse" type="xsd:string"/>
+                    </sequence>
+                </complexType>
+            </element>                     
+        </schema>
+    </wsdl:types>
+    
+    <wsdl:message name="HelloMessage">
+        <wsdl:part element="tns:hello" name="TestPart"/>
+    </wsdl:message>
+    
+    <wsdl:message name="HelloMessageResponse">
+        <wsdl:part element="tns:helloResponse" name="TestResponse"/>
+    </wsdl:message>
+    
+    <wsdl:portType name="HelloPortType">
+        <wsdl:operation name="hello">
+            <wsdl:input message="tns:HelloMessage" name="TestIn"/>
+            <wsdl:output message="tns:HelloMessageResponse" name="TestOut"/>
+        </wsdl:operation>    
+    </wsdl:portType>
+    
+
+    <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
+        <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="hello">
+            <wsdlsoap:operation soapAction=""/>
+            <wsdl:input name="TestIn">
+                <wsdlsoap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="TestOut">
+                <wsdlsoap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>    
+    
+    <wsdl:service name="HelloService">
+		<wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
+     		<soap:address location="http://localhost:8085/ode/processes/helloWorld"/>
+		</wsdl:port>
+    </wsdl:service>
+    
+   <plnk:partnerLinkType name="HelloPartnerLinkType">
+       <plnk:role name="me" portType="tns:HelloPortType"/>
+       <plnk:role name="you" portType="tns:HelloPortType"/>
+   </plnk:partnerLinkType>
+</wsdl:definitions>
\ No newline at end of file

Added: tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/test/java/sample/Helloworld.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/test/java/sample/Helloworld.java?rev=1095098&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/test/java/sample/Helloworld.java (added)
+++ tuscany/sca-java-2.x/trunk/samples/getting-started/helloworld-bpel/src/test/java/sample/Helloworld.java Tue Apr 19 14:17:46 2011
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+package sample;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@Remotable
+public interface Helloworld {
+
+    String sayHello(String name);
+
+}