cancel
Showing results for 
Search instead for 
Did you mean: 

Attachment name from Sender Mail

former_member193466
Participant
0 Kudos

Hi,

We are using Sender Mail adapter where in would require to process the attachment.

Here we are using the attachment records as sourcce and the interface was working fine.

No the requirement is to send the attachment file name in one of the target field.

Can someone please letme know how we can do it without having new structures as this is already existing  one.

Thank you.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member184720
Active Contributor
0 Kudos

Hi - Have a look at the below blog.

Write a small UDF to read the filename and map it to the required target field. Below blogs will help you writing UDF..

former_member193466
Participant
0 Kudos

Hi, It seems the blog to read attachements is for PI7.1 onwards..

But I am using 7.0, can you please suggest.

former_member184720
Active Contributor
0 Kudos

I don't think we can read the attachments at the mapping level in 7.0

so have a look at the below module

Adapter Module PI 7.0 Get Attachment Name - Process Integration - SCN Wiki

After this simply using another UDF you can map this dynamic attribute to target field.

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

String attachmentName = conf.get(key);

return  attachmentName;

Message was edited by: Hareesh Gampa