Skip to Main Content
Return to Navigation

Using the XSLT Extension Function in the Transformation Program

Create a transformation program that maps the fields in the PeopleSoft ABM message to the corresponding fields in the EBM message. You will then use the XSLT functions to map the data values.

This section provides sample coding for sections of the transform application engine program for:

Key Value Transformation

This example shows the elements in XML in the ABM that need to be translated, the code for the translation, and the resulting elements in the EBM.

Key Elements for Translation in PeopleSoft ABM

Elements in XML message:

<MsgData>
    <Transaction>
      <PYMT_TRMS_HDR class="R">
        <SETID IsChanged="Y">SHARE</SETID>
        <PYMNT_TERMS_CD IsChanged="Y">DIT91</PYMNT_TERMS_CD>

XSLT Code

This snippet of the XSLT code shows the transform XSLT in the application engine program:

  1. Create a new variable by concatenating SETID and PYMT_TERMS_CD:

    <corecom:ApplicationObjectKey>
      <corecom:ID>
          <xsl:attribute name="schemeID">
              <xsl:text disable-output-escaping="no">PSFT</xsl:text>
          </xsl:attribute>
          <xsl:attribute name="schemeAgencyID"> 
              <xsl:text disable-output-escaping="no">PSFT_COMMON</xsl:text>
          </xsl:attribute>
          <xsl:variable name="NamedValuePair"select='concat("&lt;SETID&gt;",PYMT_TRMS_HDR/SETID,"&lt;/SETID&gt;&lt;PYMNT_TERMS_CD&gt;",PYMT_TRMS_HDR/PYMNT_TERMS_CD,"&lt;/PYMNT_TERMS_CD&gt;")'/>
    
  2. Use the generate-guid utility to generate a unique GUID:

          <xsl:variable name="CommonGuid" select='concat("&lt;UniqueGUID&gt;",utility:generate-guid(),"&lt;/UniqueGUID&gt;")'/>
          

    Note: This step is not necessary. If the GUID does not exist, the appropriate xref:populate function automatically generates the unique GUID.

  3. Use the xref:populateValueNVP function to add the new GUID to the cross-reference:

    <xsl:variable name="GUIDAdd" select='xref:populateValueNVP("PaymentTermGUID","PSFT",$NamedValuePair,"UniqueGUID",$CommonGuid,"ADD")'/> 
               <xsl:call-template name="Process-GUID">
                 <xsl:with-param name="returnValue">
                    <xsl:value-of select="$GUIDAdd"/>
                 </xsl:with-param>
                    <xsl:with-param name="statusDelimiter">;</xsl:with-param>
                 </xsl:call-template>
      </corecom:ID>
    
  4. Insert the values in the EBM message:

            <corecom:ContextID>
          <xsl:attribute name="schemeID">
              <xsl:text disable-output-escaping="no">SETID</xsl:text>
          </xsl:attribute>
          <xsl:attribute name="schemeAgencyID">
              <xsl:text disable-output-escaping="no">PSFT</xsl:text> 
          </xsl:attribute>
          <xsl:value-of select="PYMT_TRMS_HDR/SETID"/>
      </corecom:ContextID>
      <corecom:ContextID>
          <xsl:attribute name="schemeID">
            <xsl:text disable-output-escaping="no">Payment Terms Code</xsl:text>
          </xsl:attribute>
              <xsl:attribute name="schemeAgencyID">
              <xsl:text disable-output-escaping="no">PSFT</xsl:text>
          </xsl:attribute>
          <xsl:value-of select="PYMT_TRMS_HDR/PYMNT_TERMS_CD"/>
      </corecom:ContextID>
     

Transformed Elements in EBM Message

The transformed EBM message contains the common GUID value:

<corecom:ApplicationObjectKey>
          <corecom:ID schemeAgencyID="PSFT_COMMON"schemeID="PSFT">b15f3c34-72bc-11dd-b7dd-aaf7c4308a71</corecom:ID>
          <corecom:ContextID schemeAgencyID="PSFT" schemeID="SETID">SHARE</corecom:ContextID>
          <corecom:ContextID schemeAgencyID="PSFT" schemeID="Payment Terms Code">DIT91</corecom:ContextID>

Domain Value Transformation

This example shows the domain value elements in XML in the ABM that need to be translated, the code for the translation, and the resulting elements in the EBM.

Domain Value Elements for Translation in PeopleSoft ABM

Here is the element for language in PeopleSoft ABM message:

<<PSCAMA class="R">
        <LANGUAGE_CD>ENG</LANGUAGE_CD>

XSLT Code

This snippet of the XSLT code shows the dvm lookup in the transform application engine program:

<xsl:variable name="MsgLang" select='dvm:lookup-dvm ("LanguageCodeDVM","LANGUAGE_CD",//MsgData/Transaction/PSCAMA/LANGUAGE_CD,"COMMON",//MsgData/Transaction/PSCAMA/LANGUAGE_CD,false())'/>
<xsl:variable name="BaseLang" select='dvm:lookup-dvm("LanguageCodeDVM","LANGUAGE_CD",//MsgData/Transaction/PSCAMA/BASE_LANGUAGE_CD,"COMMON",//MsgData/Transaction/PSCAMA/BASE_LANGUAGE_CD,false())'/>
<xsl:attribute name="languageCode">
  <xsl:value-of select="substring-after($MsgLang,';')"/>
</xsl:attribute>
        

Transformed Elements in EBM Message

Here is the translated elements in the resulting EBM message:

<?xml version="1.0"?>
<paytermcreate:CreatePaymentTermEBM languageCode="500" xmlns:corepaymenttermcust="http://xmlns.oracle.com/EnterpriseObjects/Core/Custom/EBO/PaymentTerm/V1" xmlns:paytermcreate="http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/CreatePaymentTermEBM/V1">
  <corecom:EBMHeader languageCode="500" xmlns:corecom="http://xmlns.oracle.com/EnterpriseObjects/Core/Common/V2">
    <corecom:Sender>
      <corecom:ID>E900B20</corecom:ID>
    </corecom:Sender>
  </corecom:EBMHeader>