Thursday, February 3, 2022

Externalizing a parameter in content modifier and using inside Message Mapping Field level for dynamically

 Instead of using an external parameter type, use either “Constant” or “Expression” type within content modifier. And in the value column, define the external parameter.

Example:



Using groovy script, we can access inside Mapping field level dynamically value.


import com.sap.it.api.mapping.*;

def String ReadExternalProperty(String P1,MappingContext context) {

  String messageID = context.getProperty(P1);

   return messageID

  }


(or)

import com.sap.it.api.mapping.*;

import com.sap.it.api.mapping.MappingContext;

def String getProperty(String property_name, MappingContext context) {

    def propValue= context.getPropery(property_name);

   return propValue;

}


In mapping, we need to use groovy script and  call field  names maintained in Content modifier.




No comments:

Post a Comment

The sender will pass the data in JSON format without converting it to XML format. We need to read the particular field.

The sender will pass the data in JSON format without converting it to XML format. We need to read the particular field to check the conditio...