After mappings hook
Use this hook to modify the generated message after the mapping has been done. This may be necessary if you need to deviate your message from the message that is generated based on the Template. For more information about the template see Template .
In this hook, the variable 'i.message.node' is available, which is the XML node that contains the built up message. Note that if there is a repeating part in the message, the After Mappings hook is called after building up an occurrence in the repeating part.
In this example a modeled drillback session, which is placed in the drillback URL by function icm.getDrillbackURL, is replaced by another session in a special case.
long ret
long enums
long enum.node
long drillback.node
string drillback(500)
string drillback.session(20)
if tdpcg030.maty <> tdpcg.maty.sobook then
return
endif
enums = xmlFindMatch("?<drillbackURL>", i.message.node)
if enums = 0 then
return
endif
enum.node = xmlGetFirstChild(enums)
while enum.node <> 0
drillback.node = lval(xmlData$(enum.node))
drillback = xmlData$(drillback.node)
drillback = str.replace$( drillback,
"Session=tdpcg0130m010",
"Session=tdpcg0130m020")
ret = xmlRewriteDataElement(
xmlGetParent(drillback.node),
"drillbackURL",
drillback)
enum.node = xmlGetRightSibling(enum.node)
endwhile
ret = xmlDelete(enums)
This hook determines multiple values that can be used in the
mappings.