Search Results


Wednesday, January 06, 2016

Convert Async BPEL to Synchronous BPEL

Async BPEL to Syn BPEL

Following are the steps to convert Async BPEL process to Synchronous BPEL process in SOA 12c. Most of these steps should work on 11g as well (additionally the components file need changing to reflect the synchronous process).

Following files need changing


  • composite.xml
  • *.bpel
  • *.wsdl

File: composite.xml


Open Up the composite.xml and remove the highlighted values from the service tag.

<service name="asyncbpelprocess_client_ep" ui:wsdlLocation="WSDLs/AsyncBPELProcess.wsdl">
    <interface.wsdl interface="http://xmlns.oracle.com/TestMDSApplication/AsyncProcess/AsyncBPELProcess#wsdl.interface(AsyncBPELProcess)"            callbackInterface="http://xmlns.oracle.com/TestMDSApplication/AsyncProcess/AsyncBPELProcess#wsdl.interface(AsyncBPELProcessCallback)"/>
    <binding.ws port="http://xmlns.oracle.com/TestMDSApplication/AsyncProcess/AsyncBPELProcess#wsdl.endpoint(asyncbpelprocess_client_ep/AsyncBPELProcess_pt)"/>
    <callback>
      <binding.ws port="http://xmlns.oracle.com/TestMDSApplication/AsyncProcess/AsyncBPELProcess#wsdl.endpoint(asyncbpelprocess_client_ep/AsyncBPELProcessCallback_pt)"/>
    </callback>
  </service>


And remove callbackInterface from the components tag

<component name="AsyncBPELProcess" version="1.1">
    <implementation.bpel src="BPEL/AsyncBPELProcess.bpel"/>
    <componentType>
      <service name="asyncbpelprocess_client" ui:wsdlLocation="WSDLs/AsyncBPELProcess.wsdl">
        <interface.wsdl interface="http://xmlns.oracle.com/TestMDSApplication/AsyncProcess/AsyncBPELProcess#wsdl.interface(AsyncBPELProcess)"
                        callbackInterface="http://xmlns.oracle.com/TestMDSApplication/AsyncProcess/AsyncBPELProcess#wsdl.interface(AsyncBPELProcessCallback)"/>
      </service>
    </componentType>
    <property name="bpel.config.oneWayDeliveryPolicy" type="xs:string" many="false">async.persist</property>
  </component>



Change oneWayDeliveryPolicy from async.persist to required

Before
<property name="bpel.config.oneWayDeliveryPolicy" type="xs:string" many="false">async.persist</property>

After
<property name="bpel.config.transaction" type="xs:string" many="false">required</property>


File: *.wsdl


  • Open up the wsdl file that bpel uses and add output variable to the process operation.
  • Remove the callback port type.
  • Remove requester role from the partnerLinkType.

<!-- portType implemented by the AsyncBPELProcess BPEL process -->
<wsdl:portType name="AsyncBPELProcess">
<wsdl:operation name="process">
<wsdl:input message="client:AsyncBPELProcessRequestMessage"/>
<wsdl:output message="client:AsyncBPELProcessResponseMessage"/>
</wsdl:operation>
</wsdl:portType>

<!-- portType implemented by the requester of AsyncBPELProcess BPEL process
for asynchronous callback purposes
-->
<wsdl:portType name="AsyncBPELProcessCallback">
<wsdl:operation name="processResponse">
<wsdl:input message="client:AsyncBPELProcessResponseMessage"/>
</wsdl:operation>
</wsdl:portType>


<plnk:partnerLinkType name="AsyncBPELProcess">
<plnk:role name="AsyncBPELProcessProvider">
<plnk:portType name="client:AsyncBPELProcess"/>
</plnk:role>
<plnk:role name="AsyncBPELProcessRequester">
<plnk:portType name="client:AsyncBPELProcessCallback"/>
</plnk:role>
</plnk:partnerLinkType>


File: *.bpel


  • Remove partnerRole from the partnerLink tag

 <partnerLink name="asyncbpelprocess_client" partnerLinkType="client:AsyncBPELProcess" myRole="AsyncBPELProcessProvider" partnerRole="AsyncBPELProcessRequester"/>
    </partnerLinks>


  • Replace the invoke operation at the end with the reply operation
    • Before

<invoke name="callbackClient" partnerLink="asyncbpelprocess_client" portType="client:AsyncBPELProcessCallback"
            operation="processResponse" inputVariable="outputVariable"/>

    • After

<reply name="Reply" variable="outputVariable" partnerLink="asyncbpelprocess_client"
           portType="client:AsyncBPELProcess" operation="process"/>


That's it!! Build and deploy!
Finally, the SOA server might need a bounce to refresh the wsdl cache. Please leave a comment if you know an alternative way to refresh the wsdl cache.

Change calling BPEL processes


If the asychronous process is being consumed by any other BPEL processes then use the following steps to change the asynchronous calls to synchronous calls.

Following files need changing


  • composite.xml
  • *.bpel
  • *.wsdl


File: *.wsdl


If the wsdl file of the converted BPEL process is saved locally in the project or stored in the mds then it has to be updated with the latest one.


File: composite.xml


Remove callbackInterface and callback tag from the reference tag.

<reference name="asyncProc"
             ui:wsdlLocation="http://UBM58986.ubm.net:7101/soa-infra/services/testing/AsyncProcess!1.0/WSDLs/AsyncBPELProcess.wsdl">
    <interface.wsdl interface="http://xmlns.oracle.com/TestMDSApplication/AsyncProcess/AsyncBPELProcess#wsdl.interface(AsyncBPELProcess)"
                    callbackInterface="http://xmlns.oracle.com/TestMDSApplication/AsyncProcess/AsyncBPELProcess#wsdl.interface(AsyncBPELProcessCallback)"/>
    <binding.ws port="http://xmlns.oracle.com/TestMDSApplication/AsyncProcess/AsyncBPELProcess#wsdl.endpoint(asyncbpelprocess_client_ep/AsyncBPELProcess_pt)"
                location="http://UBM58986.ubm.net:7101/soa-infra/services/testing/AsyncProcess/asyncbpelprocess_client_ep?WSDL"
                soapVersion="1.1"/>
    <callback>
      <binding.ws port="http://xmlns.oracle.com/TestMDSApplication/AsyncProcess/AsyncBPELProcess#wsdl.endpoint(asyncbpelprocess_client_ep/AsyncBPELProcessCallback_pt)"/>
    </callback>
 </reference>



File: *.bpel


Remove myRole from the partnerLink tag

<partnerLink name="asyncProc" partnerLinkType="ns1:AsyncBPELProcess" myRole="AsyncBPELProcessRequester"
                 partnerRole="AsyncBPELProcessProvider"/>

Add outputVariable to the invoke operation. The output variable from the receive activity could be reused here.

<invoke name="Invoke1" partnerLink="asyncProc" portType="ns1:AsyncBPELProcess"
            operation="process" inputVariable="process_InputVariable"            outputVariable="processResponse_OutputVariable" bpelx:invokeAsDetail="no"/>

Remove the receive activity from the BPEL process

<receive name="Receive1" partnerLink="asyncProc" portType="ns1:AsyncBPELProcessCallback"
             operation="processResponse" variable="processResponse_OutputVariable"/>

All Done!!

No comments :