cancel
Showing results for 
Search instead for 
Did you mean: 

EXISTS Node function behavior got changed after patching in PI System

Former Member
0 Kudos

Hi Experts,

The EXISTS node function behavior got changed after patching in PI System.

We have used Exists node function in my mapping but unfortunately the mapping got failed after applied patching in pi system. So,now i am planning to use UDF's instead of using Exists node function. Here we have to pass only one value from source,if value is exists only then target node needs to be created and we used createif function.

Can anyone please provide us the UDF Code for resolving the issues.else is there any other ways to achieve this. please advice

Regards

Venkat

Accepted Solutions (0)

Answers (2)

Answers (2)

yeeloon-khoo
Explorer
0 Kudos

Hi Venkat,

Not sure what was change to Exists function after PI patching.

Exists function will return true, when source node exists(not null), regardless has value or empty value.

If understand correctly, you want to create target node only when source node has value(non-empty value). The function name should be "hasValue", then pair with createIf.

Harish's udf will work, and need to use mapWithDefault blank before feed into udf as mentioned.

If you want to ignore blank space not to create target node, can change to like below:

input.trim().length() > 0

If you have PI/PO with B2B MappingFunctions, UDFNodePool have function "hasValue" and "createIfHasValue" for above mentioned requirements. Save all the hassle to manually create udf.
Reference:scn.sap.com/community/b2b-integration/blog/2015/04/10/udfnodepool-explained-in-easy-example

Regards,

Yee Loon

Harish
Active Contributor
0 Kudos

Hi Venkat,

you can use the simple value UDF code after map with default blank with source function

String result = "";

if(!input.equal(""))

{

result = "true";

}

else

result = "false";

return result;

The output will be input to creatIf function.

you can also check the below SAP note

1442813 - Exist was not working correctly when the parent was empty co