Skip to Content
Author's profile photo Michal Krawczyk

Michal’s PI tips: How to check all UDFs for a specific line of code – idea

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


Step 1

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.


Step 2

As a result you will get a list of objects with a link to the “RAW” mapping specification as per screenshot below.


Step 3

Inside the RAW link you can see that one of the nodes contains a zipped source code of the mapping.


Step 4

You need to get the zipped value and decode it with BASE64 decoder.


Step 5

Now you can unzip the mapping and you will the source code.


Step 6

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.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Sunil Chandra
      Sunil Chandra

      Hi Michal,

      Happy to see this blog.

      In order to make it more practical to use you'd need to write a small tool...

      You would also be happy to know that tool is already there as MappingMaster uses exactly the same approach to fetch the mapping details. Although MappingMaster is already open source tool, this blog is making the secrets behind more public. 🙂

      This approach would be very useful as exporting mapping details using ctrl+shift+0 won't be available from PI 7.3 onwards.


      Sunil Chandra

      Author's profile photo Michal Krawczyk
      Michal Krawczyk
      Blog Post Author

      Hi Sunil,

      didn't know that mappingmaster is using the same thing 🙂 anyway at least now we get a bit more insight as you said 🙂

      thanks for the info,


      Michal Krawczyk

      Author's profile photo Nageshwar Reddy
      Nageshwar Reddy

      Nice one Michal. Thanks for sharing.