Showing posts with label Poll data. Show all posts
Showing posts with label Poll data. Show all posts

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:)

Featured Posts

Sample Real Time Assignment in Oracle SOA