Skip to Content
0
Apr 11, 2014 at 05:08 AM

SAP PI7.31 : Mail with multiple attachments - how to process via UDF

266 Views

Hi

wondering how I can approach this problem. I have to read an Email with any number of attachments - it can have between 1 and 4 or maybe more of different types (CSV,XLS,PDF,ZIP). I need to read this email and extract the attachments to a folder.

Just to let you know I have done this OK for an email that I know only has 2 attachments ! Works perfectly - just no good for ?n? attachments !

Mail Sender has AF_Modules/MultipartHeaderBean to add payload Attributes

The message is sent to 2 Receivers

Each Receiver File adapter then uses AF_Modules/DynamicConfigurationBean and AF_Modules/PayloadSwapBean

Problem is that when I do not know how many attachments there are. So I will have to write a Java UDF mapping, perhaps using the classTransformationInput.

My question is : To create a Java UDF what should be structure of a sent Email message Type look like so I can feed that into a UDF to check what payload attachments there are etc ?.