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:
-
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>