access header and properties into mapping sap cpi

def String getheader(String header_name, MappingContext context) {
    def headervalue= context.getHeader(header_name);
    return headervalue;
}

def String getProperty(String property_name, MappingContext context) {
    def propValue= context.getProperty(property_name);
    return propValue;
}

def String setHeader(String header_name, String header_value, MappingContext context) { 
    context.setHeader(header_name, header_value);   
    return header_value;
}

def String setProperty(String property_name, String property_value, MappingContext context) {
    context.setProperty(property_name, property_value);    
    return header_value;
}


https://help.sap.com/docs/cloud-integration/sap-cloud-integration/access-headers-and-properties-in-scripts?q=setProperty

-------------

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


def String getProperty(String propertyName, MappingContext context) {

    def propertyValue = context.getProperty(propertyName);

    return propertyValue;

}


def String getHeader(String headerName, MappingContext context) {

    def headerValue = context.getHeader(headerName);

    return headerValue;

}




Popular posts from this blog

praveen samples: idoc2edi: step by tpm configuration, with payloads

50 questoins of grok questions.

SAP CPI : camle expression in sap cpi , cm, router, filter and groovy script. format