Skip to Content
avatar image
Former Member

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 03, 2016 at 04:01 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 04, 2016 at 02:44 AM

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

    HCI -Integrating SalesForce (SFDC) using HCI -Part 1

    Regards,

    Bhavesh

    Add comment
    10|10000 characters needed characters exceeded