BPEL Database Polling – Oracle SOA 10.1.3.x in JDeveloper (Asynchronous)

adminTechnical Tips2 Comments

Polling for changes in a database has been a requirement for systems for a very long time. With Oracle BPEL, of course, this need exists and we will review one way you can go about this.

Note: This particular article is not meant to provide a detailed background for each step, nor does it go through showing how to test end-to-end, but feel free to ask questions in your comments and I will be happy to update any areas that you are confused about.

Objective

Create a BPEL process that would poll the database periodically for records with a specific flag.

Step-by-Step Walkthrough with Screenshots

Create an asynchronous BPEL project using JDeveloper BPEL Plugin

image1

image2

Click Finish and view the JDeveloper design view.

image3

Create a Database Adapter, by dragging and dropping ‘Database Adapter’ from the ‘Component Palette’ and begin configuring using the wizard.

image4

Click ‘Next’ and choose a name for the service that will be created and available for consumption by your BPEL process.

image5

Click ‘Next’ and select the appropriate ‘Database’ Connection from the drop down (or create a new connection if needed).

image6-500x3701

Click ‘Next’ and select ‘Poll for New or Changed Records in a Table’

image7

Click on ‘Import Tables’ and Select the table that you wish to poll.

image8 

image9

Once your table is selected:
Click ‘Next’
Click ‘Next’
Click ‘Next’

As you poll entries, you must decide on a way to read and mark entries. We have chosen to update a field, setting all values to “FALSE” since we do not want Oracle BPEL to automatically update a field as soon as it is read; instead, we want to update the value ourselves later in the process, once we are sure certain processing has been completed.

image10

image11

Note: Assuming that you will update the ‘Task_Completed’ Flag after processing the records, you might want to change the wsdl to modify polling parameters.

Modify the receive activity to get data from the new Database Adapter Service

image12

2 Comments on “BPEL Database Polling – Oracle SOA 10.1.3.x in JDeveloper (Asynchronous)”

  1. hello,
    i have to do database polling..this is wat i have done.but instance is not getting created in BPEL..

    i have created a sequence in databse.
    i have created a source table in database which has three colums id,name,sequence.(generated by doin seq.nextval)
    i have created a table as seqhelper table which has two fields table_name and seqid.

    now i hav dragged a db adapter.I hav chosen poll,update seq table..and given my seq table name,seqname filed as table_name,seqvalue field as seqid.and sequence fiels ad sequence column of source table …and done polling frequency as 5 seconds.

    now created a bpel process,chosen interface as based on wsdl and selected db adapters wsdl file and linked to bpel after removing the default exposed service of bpel..so bpel as one receive activity joined to db adapter…
    WHEN<
    i am inserting any new records to source table….instance is not getting created…please help..

Leave a Reply to Tehseen Cancel reply

Your email address will not be published. Required fields are marked *