<?xml version='1.0' encoding='UTF-8'?>
<multimap:Messages xmlns:multimap="http://sap.com/xi/XI/SplitAndMerge">
<multimap:Message1> //Message from System A (Which is SAP in our Case)
<DocNumber>100</DocNumber>
<PurchaseOrderNumber>12345</PurchaseOrderNumber> //This is the Purchase order number from SAP System
<Item>Television</Item>
</multimap:Message1>
<multimap:Message2> //Message from System B (Which is ByD in our Case)
<rfc:ZHR_GET_EMP_BENEFIT_DETAILS.Response xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
<LT_0167>
<PONum>12345</PONum> //This is the Purchase order number from ByD System
<item>
<PERNR>00012345</PERNR></item>
<DOB>01/01/2020</DOB>
....
</LT_0167>
</rfc:ZHR_GET_EMP_BENEFIT_DETAILS.Response>
</multimap:Message2>
</multimap:Messages>
<multimap:Message1> Payload from System A is captured in </multimap:Message1>
<multimap:Message2> Payload from System B is captured in </multimap:Message2>
Now in the next step we will use XPATH in content modifier.
Source Value is captured from the XML Payload
Eg. <Parent>
<Items>
<material>101213</material>
<price>100.00</price>
</Items>
</Parent>
If we want to pick only price then the source value would be.
//Parent/Items/price
In the same way select source values of both PO Numbers according to the combined payload.
Now we will use XSLT Mapping Option from Pallets.
and write the below code to compare two nodes together. (Our Logic)
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" omit-xml-declaration="no" encoding="UTF-8" indent="yes" />
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<Output>
<xsl:apply-templates select="/ParentNode/Child/PONum = /ParentNode_ByD/Child/ID"/>
</Output>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:select-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:transform>
And in last we will be using Process Direct Adapter to trigger next scenario.
--------------------------------------------------------------------------------------------
* If Nodes are not equal then user should get a mail that the iflow has failed.
To make this happen.
This step is same as in the Success Node.
Now to get a detailed error description we will use groovy script.
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message) {
def body = message.getBody(java.lang.String) as String;
def messageLog = messageLogFactory.getMessageLog(message);
if(messageLog != null){
messageLog.setStringProperty("Logging#1", "Printing Payload As Attachment")
messageLog.addAttachmentAsString("ResponsePayload:", body, "text/plain");
}
return message;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
10 | |
7 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |