Wednesday, December 19, 2012

Emailing HTML in Oracle BPEL 11g

Problem

As part of a BPEL process, I needed an email sent with two tables of information. To accomplish this I decided to send an HTML email. I created a transformation to generate my HTML and store it into a variable. Everything appeared valid , but when trying a few different methods I received one of two results.
1. Nothing would show up in the email body.
2. Only the text from the tables would appear.

Solution

The problem that occurred was that BPEL is trying to grab contents of the element rather than the elements and text contained in their entirety. To fix this <![CDATA[   ]]> needs to be wrapped around the data, this is done with the ora:toCDATA() function. This works because it tells the XML Parser in the notification service to not parse the data and treat it as plain text.

Update: Additionally in the XSL transform remember to use <xsl:output method="html" indent="yes" version="4.0"/> just before the template open tag.

Resources
http://docs.oracle.com/cd/E15523_01/doc.1111/e14770/bpel.htm#BABHFEFE

Tested Versions
Oracle SOA Suite 11.1.1.5

6 comments:

Unknown said...

If you don't mind can you please share the poc here sathish6319@gmail.com .
Thanks in advance...

karan said...

could you please send poc details to me also as to how use customized template with email?

karan said...

could you please send poc details to me also as to how use customized template with email?

kishore said...

hi,
can you please share the sample poc to kishroe.mukala@gmail.com

thanks in advance.,
M.Kishore

Darway said...

Hi,

Can you share your sample POC to drumdarway@gmail.com

Many thanks

B/Regards

Darway

Unknown said...

can you please share the code to chandu.surviver@gmail.com