import com.sap.gateway.ip.core.customdev.util.Message
import java.util.Map
import java.util.Iterator
import javax.activation.DataHandler
def Message processData(Message message) {
def attachments = message.getAttachments();
def bTypeSupported = false;
if ((attachments!=null)&&(!attachments.isEmpty())) {
attachments.values().each{ attachment ->
if (bTypeSupported == true){
return;
}
def sContentType = attachment.getContentType()
message.setProperty("MailContentType", sContentType);
sContentType = sContentType.substring(0, sContentType.lastIndexOf(";")).toLowerCase();
if (sContentType.contains("csv")){
sContentType="text/csv";
bTypeSupported = true;
}
if (bTypeSupported == true){
message.setProperty("MailContentTypeSupported", "True");
message.setBody(attachment.getContent());
message.setHeader("attachment_fileName",attachment.getName());
message.setHeader("attachment_type",sContentType);
}
}
}
return message
}
Request clarification before answering.
another problem is you cannot keep tracing enabled for longer duration and once again another pathetically designed adapter for handling things like attachment for which we have to take help from groovy script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 10 | |
| 5 | |
| 5 | |
| 5 | |
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.