ode-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phanlesang <phanles...@gmail.com>
Subject Re: Example of using loop activities
Date Tue, 14 Jul 2009 00:39:26 GMT

Hi,
I've just tested an example using while loop. But it got run out of memory
error. is there anything wrong with my code? 

Here is my code:

<!-- SimpleInvokeProcess BPEL Process [Generated by the Eclipse BPEL
Designer] -->
<bpel:process name="SimpleInvokeProcess"
        
targetNamespace="http://www.se.uni-hannover.de/soa08/tutorial/SimpleInvokeProcess"
         suppressJoinFailure="yes"
        
xmlns:tns="http://www.se.uni-hannover.de/soa08/tutorial/SimpleInvokeProcess"
        
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        
xmlns:ns1="http://randomHelloService.tutorial.soa08.se.unihannover.de">

    <!-- Import the client WSDL -->
    <bpel:import
namespace="http://randomHelloService.tutorial.soa08.se.unihannover.de"
location="RandomHelloService.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"></bpel:import>
    <bpel:import location="SimpleInvokeProcessArtifacts.wsdl"
namespace="http://www.se.uni-hannover.de/soa08/tutorial/SimpleInvokeProcess" 
	        importType="http://schemas.xmlsoap.org/wsdl/" />
         
    <!-- =================================================================
-->         
    <!-- PARTNERLINKS                                                     
-->
    <!-- List of services participating in this BPEL process              
-->
    <!-- =================================================================
-->         
    <bpel:partnerLinks>
        <!-- The 'client' role represents the requester of this service. -->
        <bpel:partnerLink name="client"
                     partnerLinkType="tns:SimpleInvokeProcess"
                     myRole="SimpleInvokeProcessProvider"
                     />
        <bpel:partnerLink name="RandomHelloPL"
partnerLinkType="tns:RandomHelloPLT"
partnerRole="RandomHelloServiceProvider"></bpel:partnerLink>
    </bpel:partnerLinks>
  
    <!-- =================================================================
-->         
    <!-- VARIABLES                                                        
-->
    <!-- List of messages and XML documents used within this BPEL process 
-->
    <!-- =================================================================
-->         
    <bpel:variables>
        <!-- Reference to the message passed as input during initiation -->
         <bpel:variable name="detailIndex" type="xsd:integer"/>
        
        <bpel:variable name="input"
                  messageType="tns:SimpleInvokeProcessRequestMessage"/>
                  
        <!-- 
          Reference to the message that will be returned to the requester
          -->
        <bpel:variable name="output"
                  messageType="tns:SimpleInvokeProcessResponseMessage"/>
        <bpel:variable name="RandomHelloRequest"
messageType="ns1:sayHelloRequest"></bpel:variable>
        <bpel:variable name="RandomHelloResponse"
messageType="ns1:sayHelloResponse"></bpel:variable>
    </bpel:variables>

    <!-- =================================================================
-->         
    <!-- ORCHESTRATION LOGIC                                              
-->
    <!-- Set of activities coordinating the flow of messages across the   
-->
    <!-- services integrated within this business process                 
-->
    <!-- =================================================================
-->         
    <bpel:sequence name="main">
        
        <!-- Receive input from requester. 
             Note: This maps to operation defined in
SimpleInvokeProcess.wsdl 
             -->
        <bpel:receive name="receiveInput" partnerLink="client"
                 portType="tns:SimpleInvokeProcess"
                 operation="process" variable="input"
                 createInstance="yes"/>
        
        <bpel:assign validate="no">
            <bpel:copy>
                <bpel:from>
                1                    
                </bpel:from>
                <bpel:to variable="detailIndex"></bpel:to>
            </bpel:copy>
        </bpel:assign>
        
        <bpel:while>
        <bpel:condition
expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
        <![CDATA[$detailIndex <= 10]]>
        </bpel:condition>
        <!-- Generate reply to synchronous request -->
        <bpel:assign validate="no" name="PrepareRandomHelloRequest">
            <bpel:copy>
                <bpel:from>
                    <bpel:literal xml:space="preserve"><impl:sayHello
xmlns:impl="http://randomHelloService.tutorial.soa08.se.unihannover.de"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <impl:withSpace></impl:withSpace>
</impl:sayHello>
</bpel:literal>
                </bpel:from>
                <bpel:to variable="RandomHelloRequest"
part="parameters"></bpel:to>
            </bpel:copy>
            <bpel:copy>
                <bpel:from>
                    <bpel:literal xml:space="preserve">true</bpel:literal>
                </bpel:from>
                <bpel:to part="parameters" variable="RandomHelloRequest">
                    <bpel:query
queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[ns1:withSpace]]></bpel:query>
                </bpel:to>
            </bpel:copy>
        </bpel:assign>
        <bpel:invoke name="GetGreeting" partnerLink="RandomHelloPL"
operation="sayHello" portType="ns1:RandomHelloService"
inputVariable="RandomHelloRequest"
outputVariable="RandomHelloResponse"></bpel:invoke>
        
        <bpel:assign validate="no">
            <bpel:copy>
                <bpel:from>
                 <![CDATA[$detailIndex + 1]]>                    
                </bpel:from>
                <bpel:to variable="detailIndex"></bpel:to>
            </bpel:copy>
        </bpel:assign>
        
        </bpel:while>
        <bpel:assign validate="no" name="PrepareOutput">
            <bpel:copy>
                <bpel:from xmlns:http="urn:http:namesapce">
                   
<![CDATA[concat(bpel:getVariableData('RandomHelloResponse', 'parameters',
'/'), bpel:getVariableData('input', 'payload', '/'))]]>
                </bpel:from>
                <bpel:to variable="output" part="payload"></bpel:to>
            </bpel:copy>
        </bpel:assign>
        <bpel:reply name="replyOutput" 
               partnerLink="client"
               portType="tns:SimpleInvokeProcess"
               operation="process" 
               variable="output"
               />
    </bpel:sequence>
</bpel:process>

Thanks for any help!


-----
Sang PL
-- 
View this message in context: http://www.nabble.com/Example-of-using-loop-activities-tp24471660p24471879.html
Sent from the Apache Ode User mailing list archive at Nabble.com.


Mime
View raw message