During PI migrations for the new java version of the new PI some of us might experience issues related to the fact that custom written code does not work in one of the user defined functions from the message mapping. If we know which part of code is causing the error we can always easily find it out by checking all UDFs in the mappings. What if we have a bit more then just a few mappings (like thousands) and same number of UDFs ? Do we need to go one by one ? Let me share with you and idea on how this issue can be solved.
How to get the source code of UDFs for all the mappings?
Use the SimpleQuery to get the UDFs source code
Use the SimpleQuery to get all of the mappings from the ESR. You need to select object - Message Mapping and in the Result attributes - Link to object.
As a result you will get a list of objects with a link to the "RAW" mapping specification as per screenshot below.
Inside the RAW link you can see that one of the nodes contains a zipped source code of the mapping.
You need to get the zipped value and decode it with BASE64 decoder.
Now you can unzip the mapping and you will the source code.
Now you can easily check in all UDFs for the string wich you need to replace and get the message mapping name from it
In order to make it more practical to use you'd need to write a small tool which can get all the RAW source codes from all of your Message Mappings automatically but this is much easier if you know where to look for the code.
Please let me know what you think of this approach - thank you.