Wednesday, 24 July 2019

SOACS - Dynamic Routing

Use the following steps to invoke target composites dynamically.

  • Create a schema file using below given schema. 
  • Create a variable (CustomEndPoint) to hold the dynamic URL. 
  • Select variable type as Element and select the element from the above created schema file. 
  • Assign the following endpoint elements to the variable - $CustomEndPoint.
    • use literal option (next to expression builder)
    • Use append rule. 
             <wsa:EndpointReference xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing">
             <wsa:Address/>
            </wsa:EndpointReference>

  • assign the variable end point to following target element.
    • $CustomEndPoint/wsa:EndpointReference/wsa:Address 
  • Assign the variable - $CustomEndPoint to target partnerlink (Target side select the partner links and select the target reference)
  • Add the following name space to BPEL. 
    • xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing"

Schema:


<?xml version='1.0' encoding='UTF-8'?>
<xsd:schema targetNamespace="http://docs.oasis-open.org/wsbpel/2.0/serviceref" 
xmlns:sref="http://docs.oasis-open.org/wsbpel/2.0/serviceref" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
elementFormDefault="qualified" blockDefault="#all">
   <xsd:annotation>
      <xsd:documentation>Service Reference Schema for WS-BPEL 2.0</xsd:documentation>
   </xsd:annotation>
   <xsd:element name="service-ref" type="sref:ServiceRefType">
      <xsd:annotation>
         <xsd:documentation>This element can be used within a from-spec.</xsd:documentation>
      </xsd:annotation>
   </xsd:element>
   <xsd:complexType name="ServiceRefType">
      <xsd:annotation>
         <xsd:documentation>This type definition is for service reference container.
This container is used as envelope to wrap around the actual endpoint reference value,
when a BPEL process interacts the endpoint reference of a partnerLink.
It provides pluggability of different versions of service referencing schemes
being used within a BPEL program. The design pattern here is similar to those of
expression language.</xsd:documentation>
      </xsd:annotation>
      <xsd:sequence>
         <xsd:any namespace="##other" processContents="lax"/>
      </xsd:sequence>
      <xsd:attribute name="reference-scheme" type="xsd:anyURI"/>
   </xsd:complexType>
</xsd:schema>

No comments:

Post a Comment