Author: objectiser
Date: 2010-08-23 11:40:32 -0400 (Mon, 23 Aug 2010)
New Revision: 922
Added:
trunk/samples/quickstart/while_wait/
trunk/samples/quickstart/while_wait/.project
trunk/samples/quickstart/while_wait/.settings/
trunk/samples/quickstart/while_wait/.settings/org.eclipse.wst.common.component
trunk/samples/quickstart/while_wait/.settings/org.eclipse.wst.common.project.facet.core.xml
trunk/samples/quickstart/while_wait/bpelContent/
trunk/samples/quickstart/while_wait/bpelContent/FibonacciProcess.bpel
trunk/samples/quickstart/while_wait/bpelContent/FibonacciProcess.wsdl
trunk/samples/quickstart/while_wait/bpelContent/FibonacciService.wsdl
trunk/samples/quickstart/while_wait/bpelContent/FibonacciService_schema1.xsd
trunk/samples/quickstart/while_wait/bpelContent/bpel-deploy.xml
trunk/samples/quickstart/while_wait/build.xml
trunk/samples/quickstart/while_wait/messages/
trunk/samples/quickstart/while_wait/messages/fib_request.xml
trunk/samples/quickstart/while_wait/readme.txt
trunk/samples/quickstart/while_wait/war/
trunk/samples/quickstart/while_wait/war/resources/
trunk/samples/quickstart/while_wait/war/resources/WEB-INF/
trunk/samples/quickstart/while_wait/war/resources/WEB-INF/lib/
trunk/samples/quickstart/while_wait/war/resources/WEB-INF/web.xml
trunk/samples/quickstart/while_wait/war/src/
trunk/samples/quickstart/while_wait/war/src/org/
trunk/samples/quickstart/while_wait/war/src/org/jboss/
trunk/samples/quickstart/while_wait/war/src/org/jboss/soa/
trunk/samples/quickstart/while_wait/war/src/org/jboss/soa/bpel/
trunk/samples/quickstart/while_wait/war/src/org/jboss/soa/bpel/samples/
trunk/samples/quickstart/while_wait/war/src/org/jboss/soa/bpel/samples/quickstart/
trunk/samples/quickstart/while_wait/war/src/org/jboss/soa/bpel/samples/quickstart/ws/
trunk/samples/quickstart/while_wait/war/src/org/jboss/soa/bpel/samples/quickstart/ws/Fibonacci.java
trunk/samples/quickstart/while_wait/war/src/org/jboss/soa/bpel/samples/quickstart/ws/FibonacciCounter.java
trunk/samples/quickstart/while_wait/war/src/org/jboss/soa/bpel/samples/quickstart/ws/IDGenerator.java
trunk/samples/quickstart/while_wait/war/view/
trunk/samples/quickstart/while_wait/war/view/index.jsp
Modified:
trunk/distribution/src/main/assembly/bin.xml
Log:
RIFTSAW-273 - Add Marek's quickstart using while and wait.
Modified: trunk/distribution/src/main/assembly/bin.xml
===================================================================
--- trunk/distribution/src/main/assembly/bin.xml 2010-08-22 20:53:36 UTC (rev 921)
+++ trunk/distribution/src/main/assembly/bin.xml 2010-08-23 15:40:32 UTC (rev 922)
@@ -84,6 +84,7 @@
<include>quickstart/simple_correlation/**</include>
<include>quickstart/simple_invoke/**</include>
<include>quickstart/simple_pick/**</include>
+ <include>quickstart/while_wait/**</include>
<include>tutorial/BPEL-BluePrint1/**</include>
<include>tutorial/BPEL-BluePrint2/**</include>
<include>tutorial/BPEL-BluePrint3/**</include>
Added: trunk/samples/quickstart/while_wait/.project
===================================================================
--- trunk/samples/quickstart/while_wait/.project (rev 0)
+++ trunk/samples/quickstart/while_wait/.project 2010-08-23 15:40:32 UTC (rev 922)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>Quickstart_bpel_while_wait</name>
+ <comment></comment>
+ <projects>
+ <project>Quickstart_bpel_while_wait</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/while_wait/.settings/org.eclipse.wst.common.component
===================================================================
--- trunk/samples/quickstart/while_wait/.settings/org.eclipse.wst.common.component
(rev 0)
+++
trunk/samples/quickstart/while_wait/.settings/org.eclipse.wst.common.component 2010-08-23
15:40:32 UTC (rev 922)
@@ -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_fibonacci">
+ <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/while_wait/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
---
trunk/samples/quickstart/while_wait/.settings/org.eclipse.wst.common.project.facet.core.xml
(rev 0)
+++
trunk/samples/quickstart/while_wait/.settings/org.eclipse.wst.common.project.facet.core.xml 2010-08-23
15:40:32 UTC (rev 922)
@@ -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/while_wait/bpelContent/FibonacciProcess.bpel
===================================================================
--- trunk/samples/quickstart/while_wait/bpelContent/FibonacciProcess.bpel
(rev 0)
+++ trunk/samples/quickstart/while_wait/bpelContent/FibonacciProcess.bpel 2010-08-23
15:40:32 UTC (rev 922)
@@ -0,0 +1,134 @@
+<!--
+ ~ 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.
+ -->
+<bpel:process name="FibonacciProcess"
+
targetNamespace="http://www.jboss.org/bpel/examples"
+ suppressJoinFailure="yes"
+
xmlns:tns="http://www.jboss.org/bpel/examples"
+
xmlns:ns="http://jboss.org/fibonacii"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable...
+
+ <bpel:import location="FibonacciProcess.wsdl"
+
namespace="http://www.jboss.org/bpel/examples"
+
importType="http://schemas.xmlsoap.org/wsdl/" />
+ <bpel:import location="FibonacciService.wsdl"
+
namespace="http://jboss.org/fibonacii"
+
importType="http://schemas.xmlsoap.org/wsdl/" />
+
+ <bpel:partnerLinks>
+ <bpel:partnerLink name="client"
partnerLinkType="tns:FibonacciProcess"
myRole="FibonacciProcess_Provider"/>
+ <bpel:partnerLink name="service"
partnerLinkType="ns:FibonacciService_PartnerLink"
partnerRole="FibonacciService_Provider"
initializePartnerRole="yes"/>
+ </bpel:partnerLinks>
+
+ <bpel:variables>
+ <bpel:variable name="input"
messageType="tns:FibonacciProcessRequestMessage"/>
+ <bpel:variable name="output"
messageType="tns:FibonacciProcessResponseMessage"/>
+ <bpel:variable name="fibonacciInput"
messageType="ns:computeFibonacciRow"/>
+ <bpel:variable name="fibonacciOutput"
messageType="ns:computeFibonacciRowResponse"/>
+ <bpel:variable name="statusInput"
messageType="ns:getResult"/>
+ <bpel:variable name="statusOutput"
messageType="ns:getResultResponse"/>
+ </bpel:variables>
+
+ <bpel:sequence name="main">
+
+ <bpel:receive name="receiveInput"
+ partnerLink="client"
+ portType="tns:FibonacciProcess"
+ operation="fibonacci" variable="input"
+ createInstance="yes"/>
+
+ <bpel:assign validate="no" name="prepareFibonacci">
+ <bpel:copy>
+ <bpel:from>
+ <bpel:literal>
+ <ns:computeFibonacciRow><n/></ns:computeFibonacciRow>
+ </bpel:literal>
+ </bpel:from>
+ <bpel:to>$fibonacciInput.parameters</bpel:to>
+ </bpel:copy>
+ <bpel:copy>
+ <bpel:from>$input.n</bpel:from>
+ <bpel:to>$fibonacciInput.parameters/n</bpel:to>
+ </bpel:copy>
+ </bpel:assign>
+
+ <bpel:invoke name="startFibonacci"
+ partnerLink="service"
+ operation="computeFibonacciRow"
+ portType="ns:FibonacciWS"
+ inputVariable="fibonacciInput"
+ outputVariable="fibonacciOutput"/>
+
+ <bpel:assign validate="no" name="prepareChecker">
+ <bpel:copy>
+ <bpel:from>
+ <bpel:literal>
+ <ns:getResult><id/></ns:getResult>
+ </bpel:literal>
+ </bpel:from>
+ <bpel:to>$statusInput.parameters</bpel:to>
+ </bpel:copy>
+ <bpel:copy>
+ <bpel:from>$fibonacciOutput.parameters/return</bpel:from>
+ <bpel:to>$statusInput.parameters/id</bpel:to>
+ </bpel:copy>
+ <bpel:copy>
+ <bpel:from>
+ <bpel:literal>
+ <ns:getResultResponse><return/></ns:getResultResponse>
+ </bpel:literal>
+ </bpel:from>
+ <bpel:to>$statusOutput.parameters</bpel:to>
+ </bpel:copy>
+ </bpel:assign>
+
+ <bpel:while name="while">
+ <bpel:condition>$statusOutput.parameters/return =
''</bpel:condition>
+ <bpel:sequence>
+
+ <bpel:invoke name="checkResult"
+ partnerLink="service"
+ operation="getResult"
+ portType="ns:FibonacciWS"
+ inputVariable="statusInput"
+ outputVariable="statusOutput"/>
+
+ <bpel:wait name="wait">
+ <bpel:for>'PT3S'</bpel:for>
+ </bpel:wait>
+
+ </bpel:sequence>
+ </bpel:while>
+
+ <bpel:assign>
+ <bpel:copy>
+ <bpel:from>$statusOutput.parameters/return</bpel:from>
+ <bpel:to>$output.response</bpel:to>
+ </bpel:copy>
+ </bpel:assign>
+
+ <bpel:reply name="replyOutput"
+ partnerLink="client"
+ portType="tns:FibonacciProcess"
+ operation="fibonacci"
+ variable="output"/>
+
+ </bpel:sequence>
+</bpel:process>
+
Added: trunk/samples/quickstart/while_wait/bpelContent/FibonacciProcess.wsdl
===================================================================
--- trunk/samples/quickstart/while_wait/bpelContent/FibonacciProcess.wsdl
(rev 0)
+++ trunk/samples/quickstart/while_wait/bpelContent/FibonacciProcess.wsdl 2010-08-23
15:40:32 UTC (rev 922)
@@ -0,0 +1,67 @@
+<?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.
+ -->
+<definitions name="FibonacciProcess"
+
targetNamespace="http://www.jboss.org/bpel/examples"
+
xmlns:tns="http://www.jboss.org/bpel/examples"
+
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+
+ <types>
+ </types>
+
+ <message name="FibonacciProcessRequestMessage">
+ <part name="n" type="xsd:int"/>
+ </message>
+ <message name="FibonacciProcessResponseMessage">
+ <part name="response" type="xsd:string"/>
+ </message>
+
+ <portType name="FibonacciProcess">
+ <operation name="fibonacci">
+ <input message="tns:FibonacciProcessRequestMessage" />
+ <output message="tns:FibonacciProcessResponseMessage"/>
+ </operation>
+ </portType>
+
+ <binding name="FibonacciProcessBinding"
type="tns:FibonacciProcess">
+ <soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http" />
+ <operation name="fibonacci">
+ <soap:operation
soapAction="http://www.jboss.org/bpel/examples/fibonacci" />
+ <input>
+ <soap:body use="literal"
namespace="http://www.jboss.org/bpel/examples" />
+ </input>
+ <output>
+ <soap:body use="literal"
namespace="http://www.jboss.org/bpel/examples" />
+ </output>
+ </operation>
+ </binding>
+
+ <service name="FibonacciProcessService">
+ <port name="FibonacciProcessServicePort"
binding="tns:FibonacciProcessBinding">
+ <soap:address
location="http://localhost:8080/Quickstart_bpel_while_waitWS" />
+ </port>
+ </service>
+
+ <plnk:partnerLinkType name="FibonacciProcess">
+ <plnk:role name="FibonacciProcess_Provider"
portType="tns:FibonacciProcess"/>
+ </plnk:partnerLinkType>
+
+</definitions>
Added: trunk/samples/quickstart/while_wait/bpelContent/FibonacciService.wsdl
===================================================================
--- trunk/samples/quickstart/while_wait/bpelContent/FibonacciService.wsdl
(rev 0)
+++ trunk/samples/quickstart/while_wait/bpelContent/FibonacciService.wsdl 2010-08-23
15:40:32 UTC (rev 922)
@@ -0,0 +1,99 @@
+<?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.
+ -->
+<definitions name="FibonacciService"
+
targetNamespace="http://jboss.org/fibonacii"
+
xmlns="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:tns="http://jboss.org/fibonacii"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype">
+
+ <types>
+ <xsd:schema>
+ <xsd:import
namespace="http://jboss.org/fibonacii"
schemaLocation="FibonacciService_schema1.xsd" />
+ </xsd:schema>
+ </types>
+
+ <message name="getResult">
+ <part name="parameters" element="tns:getResult" />
+ </message>
+ <message name="getResultResponse">
+ <part name="parameters" element="tns:getResultResponse" />
+ </message>
+ <message name="Exception">
+ <part name="fault" element="tns:Exception" />
+ </message>
+ <message name="computeFibonacciRow">
+ <part name="parameters" element="tns:computeFibonacciRow" />
+ </message>
+ <message name="computeFibonacciRowResponse">
+ <part name="parameters"
element="tns:computeFibonacciRowResponse" />
+ </message>
+
+ <portType name="FibonacciWS">
+ <operation name="getResult">
+ <input message="tns:getResult" />
+ <output message="tns:getResultResponse" />
+ <fault message="tns:Exception" name="Exception" />
+ </operation>
+ <operation name="computeFibonacciRow">
+ <input message="tns:computeFibonacciRow" />
+ <output message="tns:computeFibonacciRowResponse" />
+ </operation>
+ </portType>
+
+ <binding name="FibonacciWSBinding" type="tns:FibonacciWS">
+ <soap:binding
transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
+ <operation name="getResult">
+ <soap:operation soapAction="" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ <fault name="Exception">
+ <soap:fault name="Exception" use="literal" />
+ </fault>
+ </operation>
+ <operation name="computeFibonacciRow">
+ <soap:operation soapAction="" />
+ <input>
+ <soap:body use="literal" />
+ </input>
+ <output>
+ <soap:body use="literal" />
+ </output>
+ </operation>
+ </binding>
+
+ <service name="FibonacciService">
+ <port name="FibonacciWSPort"
binding="tns:FibonacciWSBinding">
+ <soap:address
location="http://localhost:8080/Quickstart_bpel_while_wait/FibonacciWS" />
+ </port>
+ </service>
+
+ <plnk:partnerLinkType name="FibonacciService_PartnerLink">
+ <plnk:role name="FibonacciService_Provider"
portType="tns:FibonacciWS" />
+ <plnk:role name="FibonacciService_Receiver"
portType="tns:FibonacciWS" />
+ </plnk:partnerLinkType>
+
+</definitions>
+
Added: trunk/samples/quickstart/while_wait/bpelContent/FibonacciService_schema1.xsd
===================================================================
--- trunk/samples/quickstart/while_wait/bpelContent/FibonacciService_schema1.xsd
(rev 0)
+++
trunk/samples/quickstart/while_wait/bpelContent/FibonacciService_schema1.xsd 2010-08-23
15:40:32 UTC (rev 922)
@@ -0,0 +1,62 @@
+<?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.
+ -->
+<xs:schema version="1.0"
targetNamespace="http://jboss.org/fibonacii"
xmlns:tns="http://jboss.org/fibonacii"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:element name="Exception" type="tns:Exception"/>
+
+ <xs:element name="computeFibonacciRow"
type="tns:computeFibonacciRow"/>
+
+ <xs:element name="computeFibonacciRowResponse"
type="tns:computeFibonacciRowResponse"/>
+
+ <xs:element name="getResult" type="tns:getResult"/>
+
+ <xs:element name="getResultResponse"
type="tns:getResultResponse"/>
+
+ <xs:complexType name="computeFibonacciRow">
+ <xs:sequence>
+ <xs:element name="n" type="xs:int"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="computeFibonacciRowResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:long"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="getResult">
+ <xs:sequence>
+ <xs:element name="id" type="xs:long"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="getResultResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string"
minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="Exception">
+ <xs:sequence>
+ <xs:element name="message" type="xs:string"
minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
+
Added: trunk/samples/quickstart/while_wait/bpelContent/bpel-deploy.xml
===================================================================
--- trunk/samples/quickstart/while_wait/bpelContent/bpel-deploy.xml
(rev 0)
+++ trunk/samples/quickstart/while_wait/bpelContent/bpel-deploy.xml 2010-08-23 15:40:32
UTC (rev 922)
@@ -0,0 +1,14 @@
+<?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"
xmlns:fibonacii="http://jboss.org/fibonacii">
+ <process name="examples:FibonacciProcess">
+ <active>true</active>
+ <retired>false</retired>
+ <process-events generate="all"/>
+ <provide partnerLink="client">
+ <service name="examples:FibonacciProcessService"
port="FibonacciProcessServicePort"/>
+ </provide>
+ <invoke partnerLink="service">
+ <service name="fibonacii:FibonacciService"
port="FibonacciWSPort"/>
+ </invoke>
+ </process>
+</deploy>
\ No newline at end of file
Added: trunk/samples/quickstart/while_wait/build.xml
===================================================================
--- trunk/samples/quickstart/while_wait/build.xml (rev 0)
+++ trunk/samples/quickstart/while_wait/build.xml 2010-08-23 15:40:32 UTC (rev 922)
@@ -0,0 +1,76 @@
+<project name="Quickstart_bpel_while_wait" default="deploy"
basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <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" />
+
+ <property name="war.build.dir"
location="build/war/classes"/>
+
+ <path id="compile-classpath">
+ <fileset dir="${org_jboss_as_home}/client" includes="*.jar"
/> <!-- Required for JMS Client Code. -->
+ </path>
+ <property name="compile-classpath"
refid="compile-classpath"/>
+
+ <target name="makewar" description="make war">
+ <!-- Compile... -->
+ <mkdir dir="${war.build.dir}" />
+ <javac srcdir="war/src" destdir="${war.build.dir}"
debug="true">
+ <classpath>
+ <path refid="compile-classpath" />
+ <fileset dir="war/resources/WEB-INF/lib"
includes="*.jar" />
+ </classpath>
+ </javac>
+
+ <!-- War... -->
+ <war warfile="build/${ant.project.name}.war"
+ webxml="${basedir}/war/resources/WEB-INF/web.xml">
+ <webinf dir="${basedir}/war/resources/WEB-INF">
+ <include name="jboss-web.xml"/>
+ </webinf>
+ <classes dir="${war.build.dir}"
includes="**/*.class"/>
+ <fileset dir="${basedir}/war/view">
+ <include name="**/*"/>
+ </fileset>
+ <classes dir="${basedir}">
+ <include name="juddi.properties"/>
+ </classes>
+ </war>
+ </target>
+
+ <target name="deploywar" depends="makewar" >
+ <copy todir="${deploy.dir}"
+ file="build/${ant.project.name}.war"/>
+ </target>
+
+ <target name="undeploywar">
+ <delete file="${deploy.dir}/${ant.project.name}.war"/>
+ </target>
+
+ <target name="deploy" depends="deploywar" >
+ <echo>Deploy ${ant.project.name}</echo>
+ <jar basedir="bpelContent"
destfile="${deploy.dir}/${sample.jar.name}" />
+ </target>
+
+ <target name="undeploy" depends="undeploywar" >
+ <echo>Undeploy ${ant.project.name}</echo>
+ <delete file="${deploy.dir}/${sample.jar.name}" />
+ </target>
+
+ <target name="sendreq">
+ <echo>Send test message to: ${ant.project.name}</echo>
+ <java
classname="org.apache.ode.tools.sendsoap.cline.HttpSoapSender">
+ <arg
value="http://localhost:8080/Quickstart_bpel_while_waitWS"/>
+ <arg value="messages/fib_request.xml"/>
+ <classpath refid="rs-exec-classpath"/>
+ </java>
+ </target>
+
+</project>
Added: trunk/samples/quickstart/while_wait/messages/fib_request.xml
===================================================================
--- trunk/samples/quickstart/while_wait/messages/fib_request.xml
(rev 0)
+++ trunk/samples/quickstart/while_wait/messages/fib_request.xml 2010-08-23 15:40:32 UTC
(rev 922)
@@ -0,0 +1,8 @@
+<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:exam="http://www.jboss.org/bpel/examples">
+ <soapenv:Header/>
+ <soapenv:Body>
+ <exam:fibonacci>
+ <n>42</n>
+ </exam:fibonacci>
+ </soapenv:Body>
+</soapenv:Envelope>
Added: trunk/samples/quickstart/while_wait/readme.txt
===================================================================
--- trunk/samples/quickstart/while_wait/readme.txt (rev 0)
+++ trunk/samples/quickstart/while_wait/readme.txt 2010-08-23 15:40:32 UTC (rev 922)
@@ -0,0 +1,31 @@
+Quickstart Examples - While-Wait
+================================
+
+This is a simple example used to compute the first N elements of the fibonacci sequence.
+
+Computing a fibonacci sequence may be very time consuming, especially for higher input
+values. Therefore the process, after receiving the request performs a one-way invocation
+of the FibonacciService. After the invocation the process moves into a while loop where
it
+periodicaly checks result availability. It uses also a wait activity to make the
+loop less CPU time consuming. Please note that a better solution would be to make this
+process asynchronous.
+
+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 message
+can be found in the messages sub-folder, with the relevant WSDL being
+located in the bpel sub-folder.
+
+Alternatively, use the 'ant sendreq' command (from a command line window)
+to send the example message directly to the deployed process.
+
+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_while_waitWS?wsdl is the URL to the BPEL
process' WSDL
Added: trunk/samples/quickstart/while_wait/war/resources/WEB-INF/web.xml
===================================================================
--- trunk/samples/quickstart/while_wait/war/resources/WEB-INF/web.xml
(rev 0)
+++ trunk/samples/quickstart/while_wait/war/resources/WEB-INF/web.xml 2010-08-23 15:40:32
UTC (rev 922)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>FibonacciWS</servlet-name>
+
<servlet-class>org.jboss.soa.bpel.samples.quickstart.ws.Fibonacci</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>FibonacciWS</servlet-name>
+ <url-pattern>/FibonacciWS</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Added:
trunk/samples/quickstart/while_wait/war/src/org/jboss/soa/bpel/samples/quickstart/ws/Fibonacci.java
===================================================================
---
trunk/samples/quickstart/while_wait/war/src/org/jboss/soa/bpel/samples/quickstart/ws/Fibonacci.java
(rev 0)
+++
trunk/samples/quickstart/while_wait/war/src/org/jboss/soa/bpel/samples/quickstart/ws/Fibonacci.java 2010-08-23
15:40:32 UTC (rev 922)
@@ -0,0 +1,43 @@
+package org.jboss.soa.bpel.samples.quickstart.ws;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+
+/**
+ *
+ * @author mbaluch
+ */
+@WebService(name="FibonacciWS",
targetNamespace="http://jboss.org/fibonacii")
+public class Fibonacci {
+
+ IDGenerator gen = new IDGenerator();
+ Map<Long, FibonacciCounter> tasks = new HashMap<Long,
FibonacciCounter>();
+
+ @WebMethod(operationName = "computeFibonacciRow")
+ public long fibonacci(@WebParam(name = "n") int n) {
+ Long id = new Long(gen.next());
+ FibonacciCounter fibCounter = new FibonacciCounter(n);
+ fibCounter.start();
+
+ tasks.put(id, fibCounter);
+ return id;
+ }
+
+ @WebMethod(operationName = "getResult")
+ public String getResult(@WebParam(name = "id") long id) throws Exception {
+ if(!tasks.keySet().contains(id)) {
+ throw new Exception("No task with ID=" + id);
+ }
+
+ FibonacciCounter counter = tasks.get(id);
+ // Shouldn't return <code>null</code> value. BPEL does not like
that.
+ return (counter.isAlive()) ?
+ "" :
+ tasks.remove(id).getResult();
+ }
+
+}
Added:
trunk/samples/quickstart/while_wait/war/src/org/jboss/soa/bpel/samples/quickstart/ws/FibonacciCounter.java
===================================================================
---
trunk/samples/quickstart/while_wait/war/src/org/jboss/soa/bpel/samples/quickstart/ws/FibonacciCounter.java
(rev 0)
+++
trunk/samples/quickstart/while_wait/war/src/org/jboss/soa/bpel/samples/quickstart/ws/FibonacciCounter.java 2010-08-23
15:40:32 UTC (rev 922)
@@ -0,0 +1,39 @@
+package org.jboss.soa.bpel.samples.quickstart.ws;
+
+/**
+ *
+ * @author mbaluch
+ */
+public class FibonacciCounter extends Thread {
+
+ private int n;
+
+ private String result;
+
+ public FibonacciCounter(int n) {
+ this.n = n;
+ }
+
+ private long fibElement(int n) {
+ if (n <= 1) return n;
+ else return fibElement(n-1) + fibElement(n-2);
+ }
+
+ private String fib(int n) {
+ StringBuilder sb = new StringBuilder();
+ for (int i = 1; i <= n; i++) {
+ sb.append(fibElement(i)).append(": ");
+ }
+ return sb.substring(0, sb.length() - 2);
+ }
+
+ @Override
+ public void run() {
+ result = fib(n);
+ }
+
+ public String getResult() {
+ return result;
+ }
+
+}
Added:
trunk/samples/quickstart/while_wait/war/src/org/jboss/soa/bpel/samples/quickstart/ws/IDGenerator.java
===================================================================
---
trunk/samples/quickstart/while_wait/war/src/org/jboss/soa/bpel/samples/quickstart/ws/IDGenerator.java
(rev 0)
+++
trunk/samples/quickstart/while_wait/war/src/org/jboss/soa/bpel/samples/quickstart/ws/IDGenerator.java 2010-08-23
15:40:32 UTC (rev 922)
@@ -0,0 +1,21 @@
+package org.jboss.soa.bpel.samples.quickstart.ws;
+
+/**
+ *
+ * @author mbaluch
+ */
+public class IDGenerator {
+
+ protected volatile long current = 1;
+ protected long initial = current;
+ protected long max = Long.MAX_VALUE;
+
+ public synchronized long next() {
+ long id = current++;
+ if (current > max || current < 0) {
+ current = initial;
+ }
+ return id;
+ }
+
+}
Added: trunk/samples/quickstart/while_wait/war/view/index.jsp
===================================================================
--- trunk/samples/quickstart/while_wait/war/view/index.jsp (rev
0)
+++ trunk/samples/quickstart/while_wait/war/view/index.jsp 2010-08-23 15:40:32 UTC (rev
922)
@@ -0,0 +1,9 @@
+<html>
+ <body>
+ This is just a place holder.<br>
+ Verify the that the WS has been deployed by hitting
+ <a href="http://localhost:8080/jbossws">
+
http://localhost:8080/jbossws
+ </a>
+ </body>
+</html>
\ No newline at end of file