As promised in my previous post – Adding HTML Attachment To An Email Activity On Bpel 10g, in this post I will explain how to poll a file from the local OS and send it as an attachment.
For my example, I’ve created a simple WORD (.doc) file and put it under my Linux server.
So here also, create a new Bpel process and drag the Email activity into the process flow. Fill in the required information:
Double click on the new added Email activity and change the amount of attachments from 2 into 1:
Go to the source of the Email activity: Right click on the Email activity->View->Go to Source:
Scroll down until you will get the 3 elements: MimeType/BodyPartName/ContectBody:
Each one of the elements, responsible for the attachment configuration:
MimeType – will set the Attachment type and it’s content. It is an internet standard.
BodyPartName – will set the file name.
ContectBody – will read the content of the file
Now we need to set those elements so our attached document can be send. Change the values as follows:
For MimeType, change the expression to be: string(‘application/msword; charset=UTF-8’):
For BodyPartName change the expression to be: string(‘AttachWord.doc’):
For ContentBody change the expression to be: ora:readFile(‘file:///tmp/files/AttachWord.doc’):
Save, Build, Deploy and run.
You can see that the mail has 1 attachment with the doc file:
Good Luck
Contact Arik Lalo to get an OFFER on Oracle Products
Leave a Reply