Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Using ContentModifier output in a Groovy script

Hi experts !

My current requirement is to use a value coming from a ContentModifier header in a Groovy script.

When sending the value from ContentModifier to e-mail I used ${header.id} and I get the value, but now I need to pass it inside a groovy script.

Any idea about this ?

Thanks.

BR.

Mohammed Amine.

Former Member
replied

Hello Mohammed,

After content modifier step add script Step and add the following code.

import com.sap.gateway.ip.core.customdev.util.Message;

import java.util.HashMap;

def Message processData(Message message) {

   

    //Body

   def body = message.getBody();

   

    //Headers

    def map = message.getHeaders();

   

    //get the value associated with header 'id'

    def value = map.get("id");

   

    //Convert it to String for further usage.

    idValue =value.toString();

   

    //Write your logic here

   

    return message;

}


Regards,

Sriprasad Shivaram Bhat

1 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question