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
Domain 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:
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("<SETID>",PYMT_TRMS_HDR/SETID,"</SETID><PYMNT_TERMS_CD>",PYMT_TRMS_HDR/PYMNT_TERMS_CD,"</PYMNT_TERMS_CD>")'/>
Use the generate-guid utility to generate a unique GUID:
<xsl:variable name="CommonGuid" select='concat("<UniqueGUID>",utility:generate-guid(),"</UniqueGUID>")'/>
Note: This step is not necessary. If the GUID does not exist, the appropriate xref:populate function automatically generates the unique GUID.
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>
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>
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>