Author: objectiser
Date: 2010-08-23 12:09:07 -0400 (Mon, 23 Aug 2010)
New Revision: 923
Added:
trunk/samples/quickstart/fault_compensation/
trunk/samples/quickstart/fault_compensation/.project
trunk/samples/quickstart/fault_compensation/.settings/
trunk/samples/quickstart/fault_compensation/.settings/org.eclipse.wst.common.component
trunk/samples/quickstart/fault_compensation/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/samples/quickstart/fault_compensation/bpelContent/
trunk/samples/quickstart/fault_compensation/bpelContent/bpel-deploy.xml
trunk/samples/quickstart/fault_compensation/bpelContent/scope.bpel
trunk/samples/quickstart/fault_compensation/bpelContent/scope.wsdl
trunk/samples/quickstart/fault_compensation/build.xml
trunk/samples/quickstart/fault_compensation/messages/
trunk/samples/quickstart/fault_compensation/messages/compensate.xml
trunk/samples/quickstart/fault_compensation/messages/fail.xml
trunk/samples/quickstart/fault_compensation/messages/ok.xml
trunk/samples/quickstart/fault_compensation/readme.txt
Modified:
trunk/distribution/src/main/assembly/bin.xml
Log:
RIFTSAW-274 - add Marek's fault compensation example to distribution.
Modified: trunk/distribution/src/main/assembly/bin.xml
===================================================================
--- trunk/distribution/src/main/assembly/bin.xml 2010-08-23 15:40:32 UTC (rev 922)
+++ trunk/distribution/src/main/assembly/bin.xml 2010-08-23 16:09:07 UTC (rev 923)
@@ -71,6 +71,7 @@
<include>esb/simple_esb_proxy_invoke/**</include>
<include>esb/simple_esb_proxy_invoke2/**</include>
<include>quickstart/bpel_event_listener/**</include>
+ <include>quickstart/fault_compensation/**</include>
<include>quickstart/hello_world/**</include>
<include>quickstart/hello_world_header_ode/**</include>
<include>quickstart/hello_world_header_wsdl/**</include>
Added: trunk/samples/quickstart/fault_compensation/.project
===================================================================
--- trunk/samples/quickstart/fault_compensation/.project (rev 0)
+++ trunk/samples/quickstart/fault_compensation/.project 2010-08-23 16:09:07 UTC (rev
923)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>Quickstart_bpel_fault_compensation</name>
+ <comment></comment>
+ <projects>
+ <project>Quickstart_bpel_fault_compensation</project>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.bpel.validator.builder</name>
+ <arguments>
+ <dictionary>
+ <key>debug</key>
+ <value>false</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ </natures>
+</projectDescription>
Added:
trunk/samples/quickstart/fault_compensation/.settings/org.eclipse.wst.common.component
===================================================================
---
trunk/samples/quickstart/fault_compensation/.settings/org.eclipse.wst.common.component
(rev 0)
+++
trunk/samples/quickstart/fault_compensation/.settings/org.eclipse.wst.common.component 2010-08-23
16:09:07 UTC (rev 923)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+ <wb-module deploy-name="bpel_scope">
+ <wb-resource deploy-path="/"
source-path="/bpelContent"/>
+ <dependent-module deploy-path="/"
handle="module:/org.jboss.ide.eclipse.as.wtp.core.vcf.outputFolders/">
+ <dependency-type>consumes</dependency-type>
+ </dependent-module>
+ </wb-module>
+</project-modules>
Added:
trunk/samples/quickstart/fault_compensation/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
---
trunk/samples/quickstart/fault_compensation/.settings/org.eclipse.wst.common.project.facet.core.xml
(rev 0)
+++
trunk/samples/quickstart/fault_compensation/.settings/org.eclipse.wst.common.project.facet.core.xml 2010-08-23
16:09:07 UTC (rev 923)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <fixed facet="jbt.bpel.facet.core"/>
+ <installed facet="jbt.bpel.facet.core" version="2.0"/>
+</faceted-project>
Added: trunk/samples/quickstart/fault_compensation/bpelContent/bpel-deploy.xml
===================================================================
--- trunk/samples/quickstart/fault_compensation/bpelContent/bpel-deploy.xml
(rev 0)
+++ trunk/samples/quickstart/fault_compensation/bpelContent/bpel-deploy.xml 2010-08-23
16:09:07 UTC (rev 923)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deploy
xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
xmlns:examples="http://www.jboss.org/bpel/examples">
+ <process name="examples:scope">
+ <active>true</active>
+ <retired>false</retired>
+ <process-events generate="all"/>
+ <provide partnerLink="scopeProcess">
+ <service name="examples:scopeService"
port="scopeServicePort"/>
+ </provide>
+ </process>
+</deploy>
\ No newline at end of file
Added: trunk/samples/quickstart/fault_compensation/bpelContent/scope.bpel
===================================================================
--- trunk/samples/quickstart/fault_compensation/bpelContent/scope.bpel
(rev 0)
+++ trunk/samples/quickstart/fault_compensation/bpelContent/scope.bpel 2010-08-23 16:09:07
UTC (rev 923)
@@ -0,0 +1,145 @@
+<!--
+ ~ 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="scope"
+ suppressJoinFailure="yes"
+
targetNamespace="http://www.jboss.org/bpel/examples"
+
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:ns="http://www.jboss.org/bpel/examples"
+
xmlns:types="http://www.jboss.org/bpel/examples/types"
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable...
+
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
+ location="scope.wsdl"
+
namespace="http://www.jboss.org/bpel/examples" />
+
+
+
+ <partnerLinks>
+ <partnerLink name="scopeProcess" myRole="scopeProcess"
partnerLinkType="ns:scopeProcess" />
+ </partnerLinks>
+
+ <variables>
+ <variable name="inputMessage"
messageType="ns:scopeRequestMessage" />
+ <variable name="outputMessage"
messageType="ns:scopeResponseMessage" />
+ </variables>
+
+ <sequence>
+ <receive createInstance="yes"
+ operation="processRequest"
+ partnerLink="scopeProcess"
+ portType="ns:scopePT"
+ variable="inputMessage" />
+
+ <scope name="OuterScope">
+ <variables>
+ <variable name="localVariable" type="xsd:string" />
+ </variables>
+
+ <faultHandlers>
+ <catchAll>
+ <sequence>
+ <if name="If">
+ <condition>$inputMessage.payload/compensate =
'false'</condition>
+ <rethrow name="Rethrow"/>
+ </if>
+
+ <compensateScope target="InnerScope" />
+ </sequence>
+ </catchAll>
+ </faultHandlers>
+
+ <sequence>
+ <assign name="AssignInitialValue">
+ <copy>
+ <from>
+ <literal>Initial variable value</literal>
+ </from>
+ <to variable="localVariable" />
+ </copy>
+ </assign>
+
+ <scope name="InnerScope">
+ <compensationHandler>
+ <flow>
+ <links>
+ <link name="L1"/>
+ </links>
+
+ <assign name="AssignCompensatedValue">
+ <sources>
+ <source linkName="L1"/>
+ </sources>
+
+ <copy>
+ <from>
+ <literal>Compensated value</literal>
+ </from>
+ <to variable="localVariable"/>
+ </copy>
+ </assign>
+
+ <assign name="CopyLocalVarToOutputMessage">
+ <targets>
+ <target linkName="L1"/>
+ </targets>
+ <copy>
+ <from variable="localVariable"/>
+ <to>$outputMessage.result</to>
+ </copy>
+ </assign>
+
+ </flow>
+ </compensationHandler>
+
+ <sequence>
+ <assign name="AssignInnerScopeValue">
+ <copy>
+ <from>
+ <literal>Inner scope value</literal>
+ </from>
+ <to variable="localVariable" />
+ </copy>
+ </assign>
+ </sequence>
+
+ </scope>
+
+ <empty name="DoSomethingInteresting"/>
+
+ <if name="If">
+ <condition>$inputMessage.payload/simulateException =
'true'</condition>
+ <throw faultName="ns:propagatedFault" />
+ </if>
+
+ <assign name="CopyLocalVarToOutputMessage">
+ <copy>
+ <from variable="localVariable"/>
+ <to>$outputMessage.result</to>
+ </copy>
+ </assign>
+ </sequence>
+ </scope>
+
+ <reply operation="processRequest"
+ partnerLink="scopeProcess"
+ portType="ns:scopePT"
+ variable="outputMessage"/>
+
+ </sequence>
+</process>
Added: trunk/samples/quickstart/fault_compensation/bpelContent/scope.wsdl
===================================================================
--- trunk/samples/quickstart/fault_compensation/bpelContent/scope.wsdl
(rev 0)
+++ trunk/samples/quickstart/fault_compensation/bpelContent/scope.wsdl 2010-08-23 16:09:07
UTC (rev 923)
@@ -0,0 +1,91 @@
+<?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
targetNamespace="http://www.jboss.org/bpel/examples"
+
xmlns:tns="http://www.jboss.org/bpel/examples"
+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+
+ <wsdl:types>
+ <xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
targetNamespace="http://www.jboss.org/bpel/examples">
+
+ <xsd:complexType name="scopeFault">
+ <xsd:sequence>
+ <xsd:element name="faultMessage" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="scopeReqest">
+ <xsd:sequence>
+ <xsd:element name="simulateException"
type="xsd:boolean"/>
+ <xsd:element name="compensate" type="xsd:boolean"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ </xsd:schema>
+ </wsdl:types>
+
+ <wsdl:message name="scopeRequestMessage">
+ <wsdl:part name="payload" type="tns:scopeReqest" />
+ </wsdl:message>
+ <wsdl:message name="scopeResponseMessage">
+ <wsdl:part name="result" type="xsd:string" />
+ </wsdl:message>
+ <wsdl:message name="Exception">
+ <wsdl:part name="message" type="tns:scopeFault"/>
+ </wsdl:message>
+
+ <wsdl:portType name="scopePT">
+ <wsdl:operation name="processRequest">
+ <wsdl:input message="tns:scopeRequestMessage" />
+ <wsdl:output message="tns:scopeResponseMessage" />
+ <wsdl:fault message="tns:Exception" name="Exception" />
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="scopeServiceBinding" type="tns:scopePT">
+ <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="processRequest">
+ <soap:operation
soapAction="http://www.jboss.org/bpel/examples/receiveOrder" />
+ <wsdl:input>
+ <soap:body use="literal"
namespace="http://www.jboss.org/bpel/examples" />
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"
namespace="http://www.jboss.org/bpel/examples" />
+ </wsdl:output>
+ <wsdl:fault name="Exception">
+ <soap:fault use="literal" name="Exception"
namespace="http://www.jboss.org/bpel/examples" />
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="scopeService">
+ <wsdl:port name="scopeServicePort"
binding="tns:scopeServiceBinding">
+ <soap:address
location="http://localhost:8080/Quickstart_bpel_fault_compensationWS" />
+ </wsdl:port>
+ </wsdl:service>
+
+ <plnk:partnerLinkType name="scopeProcess">
+ <plnk:role name="scopeProcess" portType="tns:scopePT"/>
+ </plnk:partnerLinkType>
+
+</wsdl:definitions>
Added: trunk/samples/quickstart/fault_compensation/build.xml
===================================================================
--- trunk/samples/quickstart/fault_compensation/build.xml (rev 0)
+++ trunk/samples/quickstart/fault_compensation/build.xml 2010-08-23 16:09:07 UTC (rev
923)
@@ -0,0 +1,50 @@
+<project name="Quickstart_bpel_fault_compensation"
default="deploy" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <macrodef name="soap">
+ <attribute name="url"/>
+ <attribute name="message"/>
+ <sequential>
+ <echo>Send test message to: ${ant.project.name}</echo>
+ <java
classname="org.apache.ode.tools.sendsoap.cline.HttpSoapSender">
+ <arg value="@{url}"/>
+ <arg value="@{message}"/>
+ <classpath refid="rs-exec-classpath"/>
+ </java>
+ </sequential>
+ </macrodef>
+
+ <property file="../../../install/deployment.properties" />
+ <import file="../../common/base-build.xml"/>
+
+ <property name="version" value="1" />
+
+ <property name="sample.jar.name"
value="${ant.project.name}-${version}.jar" />
+
+ <target name="deploy">
+ <echo>Deploy ${ant.project.name}</echo>
+ <jar basedir="bpelContent"
destfile="${deploy.dir}/${sample.jar.name}" />
+ </target>
+
+ <target name="undeploy">
+ <echo>Undeploy ${ant.project.name}</echo>
+ <delete file="${deploy.dir}/${sample.jar.name}" />
+ </target>
+
+ <target name="sendok">
+ <soap url="http://localhost:8080/Quickstart_bpel_fault_compensationWS"
message="messages/ok.xml"/>
+ </target>
+
+ <target name="sendfail">
+ <soap url="http://localhost:8080/Quickstart_bpel_fault_compensationWS"
message="messages/fail.xml"/>
+ </target>
+
+ <target name="sendcompensate">
+ <soap url="http://localhost:8080/Quickstart_bpel_fault_compensationWS"
message="messages/compensate.xml"/>
+ </target>
+
+</project>
Added: trunk/samples/quickstart/fault_compensation/messages/compensate.xml
===================================================================
--- trunk/samples/quickstart/fault_compensation/messages/compensate.xml
(rev 0)
+++ trunk/samples/quickstart/fault_compensation/messages/compensate.xml 2010-08-23
16:09:07 UTC (rev 923)
@@ -0,0 +1,11 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:exam="http://www.jboss.org/bpel/examples">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <exam:processRequest>
+ <payload>
+ <simulateException>true</simulateException>
+ <compensate>true</compensate>
+ </payload>
+ </exam:processRequest>
+ </soapenv:Body>
+</soapenv:Envelope>
Added: trunk/samples/quickstart/fault_compensation/messages/fail.xml
===================================================================
--- trunk/samples/quickstart/fault_compensation/messages/fail.xml
(rev 0)
+++ trunk/samples/quickstart/fault_compensation/messages/fail.xml 2010-08-23 16:09:07 UTC
(rev 923)
@@ -0,0 +1,11 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:exam="http://www.jboss.org/bpel/examples">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <exam:processRequest>
+ <payload>
+ <simulateException>true</simulateException>
+ <compensate>false</compensate>
+ </payload>
+ </exam:processRequest>
+ </soapenv:Body>
+</soapenv:Envelope>
Added: trunk/samples/quickstart/fault_compensation/messages/ok.xml
===================================================================
--- trunk/samples/quickstart/fault_compensation/messages/ok.xml
(rev 0)
+++ trunk/samples/quickstart/fault_compensation/messages/ok.xml 2010-08-23 16:09:07 UTC
(rev 923)
@@ -0,0 +1,11 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:exam="http://www.jboss.org/bpel/examples">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <exam:processRequest>
+ <payload>
+ <simulateException>false</simulateException>
+ <compensate>false</compensate>
+ </payload>
+ </exam:processRequest>
+ </soapenv:Body>
+</soapenv:Envelope>
Added: trunk/samples/quickstart/fault_compensation/readme.txt
===================================================================
--- trunk/samples/quickstart/fault_compensation/readme.txt (rev
0)
+++ trunk/samples/quickstart/fault_compensation/readme.txt 2010-08-23 16:09:07 UTC (rev
923)
@@ -0,0 +1,32 @@
+Quickstart Examples - Fault Compensation
+========================================
+
+This example focuses on the Scope activity: its uses, parts and syntax. Scopes
+provide a way to organize the activities within a BPEL process. They also
+provide context for variables, fault handling, compensation, event handling
+and correlation sets.
+
+Three possible messages can be used to trigger the process. These are:
+ - ok.xml - demonstrates a standard process execution path
+ - fail.xml - demonstrates throw and rethrow activities and a fault handler
+ - compensate.xml - demonstrates scope compensation.
+
+To deploy the example, open a command line window in the example's folder,
+and simply type 'ant deploy'. To undeploy, use the command 'ant
undeploy'.
+
+To test the example, for example using the SOAPUI client, an example 'ok',
+'fail' and 'compensate' message can be found in the messages sub-folder,
with the
+relevant WSDL being located in the bpel sub-folder.
+
+Alternatively, use the 'ant sendok', 'ant sendfail' or 'ant
sendcompensate' commands
+(from a command line window) to send either message.
+
+NOTE: The "ant deploy" command will by default deploy version 1 of the
+example to the server. If you wish to change the example, and redeploy,
+then you will need to update the version number in the build.xml, or
+override the version property, e.g. "ant -Dversion=2 deploy" (and similarly
+when undeploying "ant -Dversion=2 undeploy").
+
+Some handy URLs:
+http://localhost:8080/bpel-console is the BPEL console
+http://localhost:8080/Quickstart_bpel_fault_compensationWS?wsdl is the URL to the BPEL
process' WSDL