Monday, May 16, 2011

AIA configuration properties

AIA brings us a very nice solution for maintaining variables in one global AIAConfigurationProperties.xml file (kind of ini-file) which are used at runtime. This is the perfect place for e.g. the systemID (application system id) which is used in the code to identify the application for DVM and XRef translations. Also is this systemID used to populate the EBMHeader Sender segment with information from the BSR (Business Service Repository) when the EBM is created in the BPEL RequesterABCSImpl component.

All the aia functions are described and explained in the AIA Development Guide [ref: Oracle® Application Integration Architecture - Foundation Pack 2.5: Integration Developer's Guide Release 2.5 Part No. E16465-01 December 2009].

Creation of the EBM Header in the transformation xsl file:
<xsl:variable name="serviceName" select="'{http://xmlns.oracle.com/ABCSImpl/[Application]/Core/[ABCSName]/V1}[ABCSName]'"/>
<xsl:variable name="systemID" select="aia:getServiceProperty($serviceName,'Default.SystemID',true())"/>
<xsl:variable name="senderNodeVariable" select="aia:getEBMHeaderSenderSystemNode($systemID,'')"/>
<xsl:variable name="messageIdVariable" select="orcl:generate-guid()"/>

<corecom:EBMHeader>
<corecom:EBMID>
 <xsl:value-of select="$messageIdVariable"/>
</corecom:EBMID>
<corecom:EBMName>
 <xsl:text disable-output-escaping="no">{http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/Object/V1}SyncObjectListEBM</xsl:text>
</corecom:EBMName>
<corecom:EBOName>
 <xsl:text disable-output-escaping="no">{http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/Object/V1}ObjectEBO</xsl:text>
</corecom:EBOName>
<corecom:CreationDateTime>
 <xsl:value-of select="xp20:current-dateTime()"/>
</corecom:CreationDateTime>
<corecom:VerbCode>
 <xsl:text disable-output-escaping="no">Sync</xsl:text>
</corecom:VerbCode>
<corecom:Sender>
 <corecom:ID>
  <xsl:value-of select="$senderNodeVariable/ID"/>
 </corecom:ID>
 <corecom:Description>
  <xsl:value-of select="$senderNodeVariable/Description"/>
 </corecom:Description>
 <corecom:IPAddress>
  <xsl:value-of select="$senderNodeVariable/IPAddress"/>
 </corecom:IPAddress>
 <corecom:Application>
  <corecom:ID>
   <xsl:value-of select="$senderNodeVariable/Application/ID"/>
  </corecom:ID>
  <corecom:Version>
   <xsl:value-of select="$senderNodeVariable/Application/Version"/>
  </corecom:Version>
 </corecom:Application>
 <corecom:ContactName>
  <xsl:value-of select="$senderNodeVariable/ContactName"/>
 </corecom:ContactName>
 <corecom:ContactEmail>
  <xsl:value-of select="$senderNodeVariable/ContactEmail"/>
 </corecom:ContactEmail>
 <corecom:ContactPhoneNumber>
  <xsl:value-of select="$senderNodeVariable/ContactPhone"/>
 </corecom:ContactPhoneNumber>
</corecom:Sender>


The configuration properties can also be used to retrieve the service-endpoints, pretty convenient when you'll have to deploy the code to other environments with different endpoints. When the CAVS framework is not used in your organization you can remove the whole CAVS endpoint javacode in the BPEL sourcecode which was generated by the ABCS Service Constructor. Set a webservice endpoint as follows:
<variable name="EndpointReference" element="wsa:EndpointReference"/>

<assign name="SetServiceEndpoint">
  <copy>
    <from>
      <wsa:EndpointReference xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing">
        <wsa:Address/>
      </wsa:EndpointReference>
    </from>
    <to variable="EndpointReference"/>
  </copy>
  <copy>
    <from expression="aia:getServiceProperty('{http://xmlns.oracle.com/ABCSImpl/[Application]/Core/[ABCSName]/V1}[ABCSName]','Routing.[PartnerLinkName].EndpointURI',true())"/>
    <to variable="EndpointReference" query="/wsa:EndpointReference/wsa:Address"/>
  </copy>
  <copy>
    <from variable="EndpointReference"/>
    <to partnerLink="[PartnerLinkName]"/>
  </copy>
</assign>


Besides populating the BSR with the application information to populate the EBM Sender elements, by logging into the /AIA site, go to Setup and then tab System, the key field here is System Code = systemID. The properties mentioned above have to be configured in the AIA file before lookup:
$AIA_HOME/config/AIAConfigurationProperties.xml, just above the </AIAConfiguration> tag:
<!-- [ABCSName] -->
<ServiceConfiguration serviceName="{http://xmlns.oracle.com/ABCSImpl/[Application]/Core/[ABCSName]/V1}[ABCSName]">
 <Property name="Default.SystemID">APPLICATION_01</Property>
 <Property name="Routing.[PartnerLinkName].EndpointURI">http://[HTTP_HOST]:[HTTP_PORT]/webserviceaddress</Property>
</ServiceConfiguration>

In the transformation source code (xsl) only the serviceName has to be specified, not the systemID (APPLICATION_01). This systemID gets retrieved from the AIAConfigurationProperties xml file. After editing this file don't forget to reload the AIA Configuration properties: log in the /AIA site, go to setup, go to configuration and after scrolling down you'll find the Reload button.

It's worth to mention that this AIA Configuration Properties file contains environment-specific properties, like partnerlink endpoints. Use the same procedure here as you have for managing connection pools and other physical endpoints/jdbc urls/id's per application per environment.

1 comment: