Wednesday, May 7, 2008

Insert New Line Character in BPEL Payload

Today my colleague has an interesting requirement. He need to interact with a legacy application which accepts input in CSV format. In the input first row should contain operation name, second row should contain all the column names and the next row is the data row. He was using Oracle BPEL to integrate legacy application with new application infrastructure. He was having data in a canonical business object and want to generate the required input CSV format.

The major challenge for him was to transform the business object into the input CSV which is having three rows. As he was a Java developer in the past, he tried using \n to insert new line character with no luck. Then he tried 
 which is the correct one to insert a new line character in an XML payload but when he executed the BPEL flow, 
 was inserted rather than the line break.

The trick to insert the new line character in XML payload from Oracle BPEL is to append 
 in the from expression of assign activity, then check your .bpel file it would have 
 rather than 
 because Jdeveloper replaces & with its equivalent escape character &. You need to replace & with & so it would become the correct new line character 


Marinus Snyman said...

Thanks for this post! You saved me a day before my presentation!

Nirav chhaya said...

This has been very helpful. Thanks.

Thiago Lechuga said...

I had da same problem with ESB BPEL.
You just saved a lot of time here.
Thanks :)

Unknown said...

Thanks a lot it worked for me also.

bree mady said...

Hi .. Very Urgent Please :

I am using a concat() funtcion with append in Bpel , and i need to insert a new line character after a string .

Eg: concat('String1','String2', '\n').

I couldnt insert new line using the &13#; i have tried it witha nd without quotes

Apeksha Jha said...

There are 2 things to keep in mind while inserting new line character:-
-use a transformation file
- go to source in transformation file to enter the value '
' and dont go to design view after editing the newline feed as the design view alters the value of newline feed and you will have to correct it again

Anonymous said...

Excellent blog post! Stimulates me to read much more of your work. I’ll bookmark your page so I can go back here.

Leslie Lim said...

It is great to have the opportunity to read a good quality article with useful information on topics that plenty are interested on.

Naviya Nair said...

I have read your blog its very attractive and impressive. I like it your blog.

Java Online Training Java EE Online Training Java EE Online Training Java 8 online training Core Java 8 online training

Java Online Training from India Java Online Training from India Core Java Training Online Core Java Training Online Java Training InstitutesJava Training Institutes

Ramya Krishnan said...

i went through your blog, thanks for your technical information. really useful for me.
once again thanks for your valuable info and time.
Java Training in chennai