Considerations for Creating Transformation Maps Handling Missing or Empty Elements

Working with Message Transformations 23-3 Figure 23–2 Layout of the XSLT Mapper For more information about the XSLT Mapper, see Creating Transformations with the XSLT Mapper in the Oracle Fusion Middleware Developers Guide for Oracle SOA Suite.

23.2 Creating Transformation Maps

One of the steps in configuring the integration objects for your integration process is to map the components and fields in your internal integration object to the message elements in the external integration object. You use these maps to move the data from one integration object to another.

23.2.1 Considerations for Creating Transformation Maps

When creating transformation maps, consider the following guidelines: ■ Do not make unnecessary or redundant AIAConfigurationProperties.xml lookup calls. Retrieve static configuration properties once in the very beginning of transformation. To externalize configuration for deployment time using AIAConfigurationProperties.xml, refer to Section 20.1.3.9, How to Work with AIAConfigurationProperties.xml in AIA_HOMEaia_instancesINSTANCE_ NAMEAIAMetaDataconfig. ■ Ensure that your design does not include infinite loops. ■ Develop transformation maps for each component. You should build reusable component-specific transformation maps that can be used across applications. ■ Create transformation templates for every custom element. ■ Keep the transformation maps clutter free. ■ Use domain value maps only for static lookups, not for storing configuration or setup data. 23-4 Developers Guide for Oracle Application Integration Architecture Foundation Pack Example 23–1 illustrates the domain value map lookup call to fetch Currency Code. The domain value maps should be used only for static lookup calls such as Currency Codes, Location Codes, and so on. Example 23–1 Domain Value Map Lookup Call to Fetch Currency Code corecom:PreferredFunctionalCurrencyCode xsl:value-of select=dvm:lookupValueoramds:appsAIAMetaDatadvmCURRENCY_ CODE.dvm,SenderSystemId,xsdLocal:ListOfCmuAccsyncAccountIoxsdLocal:Account xsdLocal:CurrencyCode,TargetSystemId, corecom:PreferredFunctionalCurrencyCode

23.2.2 Handling Missing or Empty Elements

Transformation logic and xpath should be designed with the possibility of missing or empty elements, as shown in Example 23–2 . Example 23–2 Sample Code Illustrating Logic Designed to Handle Missing or Empty Elements xsl:iftest=normalize- space=xsdLocal:ListOfCmuAccsyncAccountIoxsdLocal:AccountxsdLocal:AccountId text corecom:ApplicationObjectKey corecom:ID xsl:value-of select=xsdLocal:ListOfCmuAccsyncAccountIoxsdLocal:AccountxsdLocal: AccountId corecom:ID corecom:ApplicationObjectKey xsl:if In this example, an if condition exists to check the empty elements. You should adopt such transformation logic to avoid transporting empty elements across the wire.

23.2.3 How to Map an Optional Source Node to an Optional Target Node