cancel
Showing results for 
Search instead for 
Did you mean: 

Using ContentModifier output in a Groovy script

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Sriprasadsbhat
Active Contributor
0 Kudos

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

Answers (1)

Answers (1)

bhavesh_kantilal
Active Contributor
0 Kudos

You may also refer to my blog that shows some examples around the same.

Regards,

Bhavesh