cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Access a property in message mapping from a content modifier

mrflores
Explorer
0 Kudos
595

I have this groovy script 

mrflores_0-1727214077141.png

import com.sap.it.api.mapping.*;
import com.sap.gateway.ip.core.customdev.util.Message;
/
def String getProperty (String Almacen_Codigo, MappingContext context) {
String value1 = context.getProperty(Almacen_Codigo);
return value1;
}

This script "getProperty" was created   to access the property "Almacen_Codigo"  of type xpath declared in a previous content modifier , but is not reading the property for some reason, the STGE_LOC xpath refers to a value 

please do someone know? 

mrflores_1-1727214199352.png

mrflores_2-1727214342428.png

 

 

 

 

Accepted Solutions (0)

Answers (4)

Answers (4)

mrflores
Explorer
0 Kudos

I have usted the mapping function of get Property , and I have null as a result event if the field STGE_LOC is populated and in the content modifier (I changed the name of the variable to STGE_LOC instead of Almacen_Codigo  in order to use the getProperty default funciton in the mapping  

mrflores_1-1727279169676.png

 

mrflores_0-1727279001818.png

 

mrflores
Explorer
0 Kudos

 

 

alex_bundschuh
Product and Topic Expert
Product and Topic Expert
0 Kudos

you don't need a script anymore, there is a standard function provided in the mapping editor to access properties and headers

Alex

mrflores
Explorer
0 Kudos
Hi, i used but it seem is not working. I shared the testing more above with the function
tonynp
Explorer
0 Kudos

Hi,

Can you add a constant and give it as a Almacen_Codigo and map to the get property.