Wednesday, August 19, 2020

Polling multiple records at once in SOA 12c

Hi! In this post, I'm going to show you how to poll multiple records at once in database adapter in  SOA 12c. Polling multiple records instead of one record at a time helps when the data is huge.

1. Create an SOA Project with empty composite.


2. Drag and drop a DB adapter to the Exposed service swim lane. Give it a suitable name an click Next.


Select your database connection and JNDI name.


Select the Operation Type as "Poll for New or Changed Records in a Table". Click Next.


In the next screen, Click on the highlighted Import Tables button to import your table.


Select your table and click OK. In my case, I used a simple table called Student that has three columns.


Select the column that you want to make up as Primary key and click Next.


Select the columns that you need. Uncheck any columns that you don't want and click Next.


Select the operation as Logical delete.


In the Logical Delete Field, Select the column where you want to change the read value. Give the Read value that is convenient to you.


In the next screen, you'll the pre-polling query and post-polling query. To poll multiple records at once, 
give a value for database Rows per XML Document. As I want to read 5 records at once, I gave its value as 5. This number depends upon your requirement.


Click Next and you'll see your query. Leave it default if no parameters are not required.


Click Next In the next two screens and click Finish in the last screen.


3. Drag and drop a BPEL into the Components area. Give it a name and Select the Template Type as No Service.


Wire the BPEL to the database adapter.


Edit the BPEL and drag and drop a Receive activity and connect it to PollData partner link. Create a variable by clicking on green plus(+) icon. Don't forget to check the checkbox Create Instance else it will throw error.



Your composite would look like below.


Save and deploy your composite. To see if it is working fine, insert few records into the database. Click on the flow instance id to see the how the records are taken.


Here is the my receive activity flow where it took five records at a time since I gave only 5 records per XML document.


If you have any concerns, write them in the comment section below. Happy learning. Cheers:)

Wednesday, August 12, 2020

Consuming JMS message from a queue in SOA 12c

Hi! Hope everyone id doing well. Today, I'm going to show you how to consume a message from JMS queue in Oracle SOA 12c. To consume a message from the queue, first a message should be published to JMS queue. To publish a message, click here to navigate to my previous post that shows how to push a request to queue.

1. Create a SOA Project.


2. Drag and drop a JMS adapter to the Exposed Services swim lane. Give it a proper name or leave default and click Next.


Select the JMS Provider and click Next.


Select your connection and click Next.


Leave the default interface as specified later and click Next.


Select the Operation Type as Consume Message. Click Next.


Specify the Destination Name as the queue where your message lies and select the correct JNDI name.


Select the schema input message. Here, I copied the schema that I used in Publish message jms service. Click here to navigate to that publish message post.


Click Finish in the next screen.

3. Drag and drop a BPEL with Interface Type as "No Service".


Wire the BPEL to JMS Service.


Edit the BPEL and drag and drop a Receive activity. Check the check box "Create Instance". Select the Partner link as JMS Service and create a variable by clicking on green plus(+) icon. Click Apply and click OK.


As we just want to consume message, we've added only receive activity. If you want to insert the consumed data into a table, you can use a database adapter and map the values to insert the values.


Now, deploy your service. Click on the Flow Instances and Click on the Search button to see the created instances. Click on the instance id to see the flow.


Click on the ConsumeMsgBPELProcess and open Receive activity to see the consumed message.


Hope this post helped you. If you have any queries, hit them in the comment section below. Happy learning. Cheers!!

Tuesday, August 11, 2020

Pick Activity in Oracle SOA 12c

Hi! In this post, I'm going to show you how we use pick activity in Oracle SOA. Pick activity can be used to pick specific operations or pick specific services. this post will show you how to use pick activity to pick a specific operation. Let's get started.

Here, I want to have two operations Square and Cube that should give the square and cube of a number  respectively.

1. Create a SOA project. Drag and drop a BPEL. Select the operation as No Service.


Drag and drop a SOAP adapter to the Exposed Services swim lane. Click on the highlighted icon to create a wsdl with two operations if you don't have one.


Select the interface type as Synchronous Interface. Give Operation as Square and create Input and Output variables with integer type.


Modify your WSDL to add one more operation as Cube. Your final wsdl should look like this.


My WSDL source looks like this.



Now wire the BPEL to SOAP service and select the transaction as notSupported.


Edit the BPEL and drag and drop a Pick activity from components pane.


Click on the Pick operation that is just above OnMessage and check the checkbox "Create Instance". Click Apply and click OK.


Click on the OnMessage and select the partner link as SOAP service that we created and select the operation as Square. Create an input variable and click Apply and then OK.


Drag and drop a Reply activity and drag it towards the partner link and select the operation as Square. Create a variable by clicking on green plus(+) icon. Click Apply and click OK.



Drag and drop an Assign activity and click on the Reply Square output variable and add the expression as below.

$OnMessage_Square_InputVariable.Input * $OnMessage_Square_InputVariable.Input


Now do the same steps for cube operation as well.

On Message for cube operation:


Cube operation Reply activity:


In the cube Assign activity, multiple the input variable thrice as below.


After doing the above steps, your composite should look like below.


Now deploy your application and test it by selecting Square operation under Operation.




Your'll see the response as below.


Similarly, test the service with Cube operation.


You'll see the response as cube of the number you entered.


Happy learning SOA. Cheers!!

Featured Posts

Sample Real Time Assignment in Oracle SOA