Posts

Showing posts with the label XML

Oracle SOA Suite 12c- IgnoreMissingFromData

Image
This post is focused on the magical attribute of oracle BPEL process manager i.e. IgnoreMissingFromData . Let me explain the business scenario- I have created a SOA service using a BPEL process and I am using an invoke activity inside BPEL process. However, I have a scenario where I have to map input schema (xsd) elements to external web service payload variable using assign activity but the problem is that sometimes my input schema elements are empty i.e. if input schema element contains 5 variables then sometimes 3 or 2 or 1 element is empty.  This is causing runtime error in BPEL " Selection Failure ". To solve this error, either I do transformation using XSL or if-else/switch in my BPEL process. Basically I would like to pass only available elements in input payload. So there is a magical attribute  IgnoreMissingFromData   that comes with assign activity. Once the variables assignment has been done, below s...

Oracle SOA- Calling stored procedure via BPEL

Image
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- In this post, I am using BPEL2.0, JDEV11g, Oracle Database12c 1. Create a new SOA composite application and add a new soa peoject- Calling SPViaBPEL 2. Drag a new database adapter in composite swim lane (external references) 3. Start DB adapter configuration as below-   4. Provide DB Adapter Service name-  5. Select existing database connection to oracle database or create a new then select the same. Make sure your JNDI configuration exists in weblogic server outbound connection pool.  Please refer https://k10middleware.blogspot.in/2017/05/oracle-weblogic-server-new-data-source.html for creating a new data source in weblogic.   6. Select schema then procedure from browse option(packge.procedure_name) 7. Continue with default values. 8. Finish it. 9. Create a new BPEL process with new schem...

Oracle SOA BPEL inserting a new line character in XPath expression

Image
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 
 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 wher...

Oracle SOA BPEL access dynamic xml payload element using XPath

Image
In my this post, I'll showcase the scenario of accessing the XML elements for dynamic payload received. I am using Oracle SOA Suite 11g & BPEL 1.1, however same should work on higher versions also. So let's get started- Use case: I was given the below XML payload  Note that elements inside TargetEntity are dynamically generated at runtime. Corresponding XML schema is What we need to access To access the Value of  DataAttribute Name i.e.   district/ usr_circle/ Mobile etc. Solution Use XPath expression builder in your BPEL Process for assignment and use below code for the same: bpws:getVariableData('requestDetails','RequestData','/ns18:RequestData/ns18:TargetEntityData/ns18:TargetEntity/ns18:DataAttribute [@Name="NameAttribute"] /@Value') Here  NameAttribute refers to district/ usr_circle/ Mobile. So to access the value of attribute Name 'district', the XPath expression would be: bpws:getVariableDat...