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:

  1. 
  2. \n
  3. 

Finally I have got the character 
 that perfectly worked with BPEL2.0 but not with BPEL1.1.

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 &amp#13; , 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!

Comments


  1. didnt work on bpel 2.0 as well.

    ReplyDelete
  2. 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

    ReplyDelete
  3. I tried with all the possible line breakers like :


    \n




    %0A
    but none of them worked for me.

    Please Help.

    ReplyDelete
  4. Hi,


    this worked for me.
    (Use this directly into the source code of BPEL process, otherwise it won't work)

    Thanks

    ReplyDelete
  5. Hi,

    For me this concat('Dear ',XXXX,',','
    ','Your request with request ID ',XXXX,' has rejected by ',XXXX,'.') worked perfect.

    Thanks.

    ReplyDelete

Post a Comment

Popular posts from this blog

Oracle SOA Suite- Implementing Email Notification

Oracle SOA Suite 12c- PKIX path building failed & unable to find valid certification path to requested target

Migration of Oracle SOA Suite Composite from 11g to 12c