Skip to Content

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.

Problem

How to get the source code of UDFs for all the mappings? 

Solution

Use the SimpleQuery to get the UDFs source code

http://host:port/rep/support/SimpleQuery

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.

/wp-content/uploads/2012/07/linkt_to_object_115642.png

Step 2

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

/wp-content/uploads/2012/07/object_with_raw_115646.png

Step 3

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

/wp-content/uploads/2012/07/zipped_code_115647.png

Step 4

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

Decoder:

http://www.opinionatedgeek.com/dotnet/tools/Base64Decode/Default.aspx

Step 5

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

/wp-content/uploads/2012/07/result_source_115648.png

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

Note

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.

Request

Please let me know what you think of this approach – thank you.

3 Comments
You must be Logged on to comment or reply to a post.