Oracle SOA BPEL inserting a new line character in XPath expression
In my this post, I'll share the details how can you insert a new line character in your XPath expression during assignment (assign activity in BPEL). So let's get started-
JDeveloper Version- 11g (11.1.1.7)
Use case:
Well, I had a use case when I had to send SMS notification and the SMS template was something like below:
Now the problem was, BPEL XPath expression builder just help me to do string concatenation and I was stuck how to insert a new line char or to give a line break.
Since I was using BPEL1.1 and I have tried to add below chars to achieve the new line but did not worked for me:
-
- \n
-
So my XPath expression was something like
concat('Dear ',XXXX,',','
','Your request with request ID ',XXXX,' has rejected by ',XXXX,'.')
[UPDATE-03Dec2019]
I have got few responses where the solution was not working while some claims the solution worked perfectly. You can give a try with %0A as newline character with BPEL2.0
[UPDATE-12Feb2021] jDeveloper12.2.1.4 | BPEL 2.0 | Emailing issue solution
For character if I use the same via BPEL design view then JDeveloper actually converts it to 
 , and hence it didn't work. So I went to the source BPEL source view and edited 'amp' back to '& '. But still, I wasn't able to get the new line character in my email response body. Then I figured out that we need to change the MimeType from 'text/html' to 'text/plain' to make this whole thing work.
That's all!
ReplyDeletedidnt work on bpel 2.0 as well.
Enjoyed reading the article above, really explains everything in detail, the article is very interesting and effective. Thank you and good luck for the upcoming articles Oracle soa certification
ReplyDeleteI tried with all the possible line breakers like :
ReplyDelete\n
%0A
but none of them worked for me.
Please Help.
Hi,
ReplyDeletethis worked for me.
(Use this directly into the source code of BPEL process, otherwise it won't work)
Thanks
Hi,
ReplyDeleteFor me this concat('Dear ',XXXX,',','
','Your request with request ID ',XXXX,' has rejected by ',XXXX,'.') worked perfect.
Thanks.