cancel
Showing results for 
Search instead for 
Did you mean: 

Attachment tag missing even after adding groovy script for attachments

jakku
Explorer
0 Kudos

HI,

I have tried to get payload from design as attachment via groovy in plaintext (as mentioned in screenshot)

The package is deployed without any error but the attachment tag which I am expecting to supposed to show then payload is missing.

could someone suggest.

script as below and seems working fine

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

def Message processData(Message message) {
def body = message.getBody(java.lang.String) as String;
def messageLog = messageLogFactory.getMessageLog(message);
if(messageLog != null){

messageLog.addAttachmentAsString("Log current Payload:", body, "text/plain");
}
return message;
}

My requirement is to get the attachment as expectation screenshot

added the screenshot for more clarity

Accepted Solutions (1)

Accepted Solutions (1)

PriyankaChak
Active Contributor
0 Kudos

Hi,

The 'request-reply' step is not connected to 'Groovy Script'. It is connected to 'End Message'. Thats why it is not working. Please drag the connector from Request-Reply' to the 'Groovy Script' step.

Regards,

Priyanka

Answers (1)

Answers (1)

jakku
Explorer
0 Kudos

Thanks Priyanka.

Its worked now. Thanks a lot.