Guest User

BPEL_rest.bpel

a guest
Jul 12th, 2011
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 5.10 KB | None | 0 0
  1. <!-- BPEL_Rest BPEL Process [Generated by the Eclipse BPEL Designer] -->
  2. <!-- Date: Tue Jul 12 12:03:16 CEST 2011 -->
  3. <bpel:process name="BPEL_Rest"
  4.         targetNamespace="http://rest.bpel.tps"
  5.         suppressJoinFailure="yes"
  6.         xmlns:tns="http://rest.bpel.tps"
  7.         xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
  8.         xmlns:dummy="http://ode/bpel/test/blog"
  9.         >
  10.  
  11.     <!-- Import the client WSDL -->
  12.     <bpel:import location="BPEL_RestArtifacts.wsdl" namespace="http://rest.bpel.tps"
  13.             importType="http://schemas.xmlsoap.org/wsdl/" />
  14.  
  15.     <bpel:import location="RestAsWS.wsdl" namespace="http://ode/bpel/test/blog"
  16.             importType="http://schemas.xmlsoap.org/wsdl/" />
  17.  
  18.  
  19.     <!-- ================================================================= -->        
  20.     <!-- PARTNERLINKS                                                      -->
  21.     <!-- List of services participating in this BPEL process               -->
  22.     <!-- ================================================================= -->        
  23.     <bpel:partnerLinks>
  24.         <!-- The 'client' role represents the requester of this service. -->
  25.         <bpel:partnerLink name="client"
  26.                     partnerLinkType="tns:BPEL_Rest"
  27.                     myRole="BPEL_RestProvider"
  28.                     />
  29.         <bpel:partnerLink name="RestPL" partnerLinkType="tns:RestPLT" partnerRole="RestPLRole"></bpel:partnerLink>
  30.     </bpel:partnerLinks>
  31.  
  32.     <!-- ================================================================= -->        
  33.     <!-- VARIABLES                                                         -->
  34.     <!-- List of messages and XML documents used within this BPEL process  -->
  35.     <!-- ================================================================= -->        
  36.     <bpel:variables>
  37.         <!-- Reference to the message passed as input during initiation -->
  38.         <bpel:variable name="input"
  39.                  messageType="tns:BPEL_RestRequestMessage"/>
  40.                  
  41.         <!--
  42.          Reference to the message that will be returned to the requester
  43.          -->
  44.         <bpel:variable name="output"
  45.                  messageType="tns:BPEL_RestResponseMessage"/>
  46.                  
  47.         <bpel:variable name="idMsg" messageType="dummy:IdMessage"/>                  
  48.                  
  49.         <bpel:variable name="RestPLResponse" messageType="dummy:ArticleMessage"></bpel:variable>
  50.     </bpel:variables>
  51.  
  52.     <!-- ================================================================= -->        
  53.     <!-- ORCHESTRATION LOGIC                                               -->
  54.     <!-- Set of activities coordinating the flow of messages across the    -->
  55.     <!-- services integrated within this business process                  -->
  56.     <!-- ================================================================= -->        
  57.     <bpel:sequence name="main">
  58.        
  59.         <!-- Receive input from requester.
  60.             Note: This maps to operation defined in BPEL_Rest.wsdl
  61.             -->
  62.         <bpel:receive name="receiveInput" partnerLink="client"
  63.                 portType="tns:BPEL_Rest"
  64.                 operation="process" variable="input"
  65.                 createInstance="yes"/>
  66.         <bpel:assign validate="no" name="Assign_CustomerID">
  67.             <bpel:copy>
  68.                 <bpel:from>
  69.                     <bpel:literal xml:space="preserve">18</bpel:literal>
  70.                 </bpel:from>
  71.                 <bpel:to part="customerId" variable="idMsg"></bpel:to>
  72.             </bpel:copy>
  73.         </bpel:assign>
  74.        
  75.         <bpel:invoke name="Invoke" partnerLink="RestPL" operation="doGET" portType="dummy:BlogPortType" inputVariable="idMsg" outputVariable="RestPLResponse"></bpel:invoke>
  76.        
  77.         <!-- Generate reply to synchronous request -->
  78.         <bpel:assign validate="no" name="Assign_Output">
  79.             <bpel:copy>
  80.                 <bpel:from>
  81.                     <bpel:literal>
  82.                         <tns:BPEL_RestResponse xmlns:tns="http://rest.bpel.tps" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><tns:result>tns:result</tns:result>
  83.  
  84.                         </tns:BPEL_RestResponse>
  85.                     </bpel:literal>
  86.                 </bpel:from>
  87.                 <bpel:to variable="output" part="payload"></bpel:to>
  88.             </bpel:copy>
  89.             <bpel:copy>
  90.                 <bpel:from part="CUSTOMER" variable="RestPLResponse">
  91.                     <bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[FIRSTNAME]]></bpel:query>
  92.                 </bpel:from>
  93.                 <bpel:to part="payload" variable="output">
  94.                     <bpel:query queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0"><![CDATA[tns:result]]></bpel:query>
  95.                 </bpel:to>
  96.             </bpel:copy>
  97.         </bpel:assign>
  98.         <bpel:reply name="replyOutput"
  99.               partnerLink="client"
  100.               portType="tns:BPEL_Rest"
  101.               operation="process"
  102.               variable="output"
  103.               />
  104.     </bpel:sequence>
  105. </bpel:process>
Advertisement
Add Comment
Please, Sign In to add comment