Once you have made Attachments to work (UMS Adapter - All about email attachments) in your BPEL process and able to parse them, it may be necessary to retrieve the actual name of the email attachment read. The best way to do that is using out-of-the-box function as given below
The above should return attachment; filename="test.txt"; however, nothing is as simple in this world and to make it true, it is a known BUG:19492062. Luckily, we have a patch 1941333.1 available to apply and get going but it may be time consuming to request a patch, do the impact assessment and get it applied across all environments. Whilst that may be the ideal solution in the long term but to quickly test and retrieve the attachment name you can use property Content-Type as given under.
- ora:getAttachmentProperty() function on Content-Type returns text/plain; charset=UTF-8; name=test.txt; any additional text;
- Substring-before() and substring-after() have been done to intelligently extract string after name=
- emailAttachmentName- is a string type custom variable to store the attachment name
Quite simple till the patch is applied, or do we indeed need the patch now!