Creating a BAM Application using SOA Composite

BAM stands for Business Activity Monitoring and it is different from Business Intelligence in that it features real-time dashboards instead of historical reports that are typical of BI applications. In this blog I will discuss underlying BAM components and also post a working sample consisting a real-time BAM dashboard that refreshes from a relational data source. As a prerequisite to building your own BAM dashboards using this example, you will need to download and install Jdev 11g TP4 as well as BAM 11g beta that comes with it. Also you must enable SOA Suite on your Jdev. For these details, refer to this link on OTN - http://www.oracle.com/technology/products/ias/bpel/techpreview/index.html

BAM uses its active data cache to display real-time dashboards. This active data cache is updated constantly by an underlying refresh mechanism and SOA Suite composite provides a powerful yet simple way of refreshing BAM cache in real-time. On the receiving end of the SOA composite is BAM’s active data cache, which consists of BAM data objects. A Data Object is like a relational table that stores data and must be refreshed constantly. And on the other end, which is the source side of the SOA composite, can be a JMS Topic, a relational schema, a web service or just good old flat files. It entirely depends on the use case you are building. In this sample, I have used a relational table as the data source. Both ends are then connected in a SOA Suite composite using an array of Technology Adapters. More will become evident about technology adapters as we go over the sample application, but to say the least, Technology Adapters are really simple to build and screen developers from many lines of code that may be required in a native application. These adapters are the main cause behind the power and ease of development of SOA Suite composite applications.

Once you are done installing and configuring BAM on Jdev 11g TP4, you are ready to create a BAM real-time dashboard using a SOA composite. To do so, I have used a database table called inventory -

CREATE TABLE  "INVENTORY" 
( "INVENTORY_ID" NUMBER(15,0) NOT NULL ENABLE,
"PRODUCT_ID" NUMBER(15,0) NOT NULL ENABLE,
"WAREHOUSE_ID" NUMBER(15,0) NOT NULL ENABLE,
"QUANTITY" NUMBER(15,0),
"UOM" VARCHAR2(15),
"CREATED_BY" VARCHAR2(60) NOT NULL ENABLE,
"CREATION_DATE" DATE NOT NULL ENABLE,
"LAST_UPDATED_BY" VARCHAR2(60) NOT NULL ENABLE,
"LAST_UPDATE_DATE" DATE NOT NULL ENABLE,
"OBJECT_VERSION_ID" NUMBER(15,0) NOT NULL ENABLE,
"STATUS" VARCHAR2(30),
"PRODUCT_NAME" VARCHAR2(4000) NOT NULL ENABLE,
CONSTRAINT "INVENTORY_PK" PRIMARY KEY ("INVENTORY_ID") ENABLE
)
/

Define the following trigger on the table. This trigger updates the STATUS column to modified whenever UPDATE operation is performed on the table. The reason we need this trigger will become clear when we define the database adapter in our SOA composite that polls on this database table.

CREATE OR REPLACE TRIGGER  "INVENTORY_MODIFIED" 
BEFORE INSERT OR UPDATE OF INVENTORY_ID, PRODUCT_ID, WAREHOUSE_ID, QUANTITY, UOM, PRODUCT_NAME ON INVENTORY
for each row
BEGIN
:new.STATUS := 'MODIFIED';
END;
/
ALTER TRIGGER "INVENTORY_MODIFIED" ENABLE
/

Next we create a BAM data object and a dashboard based on the data object.

Start BAM Server (as instructed in install guidelines) and go to BAM console - http://localhost:8888/OracleBAM/default.htm Login with fmwadmin/ welcome1.

image

Choose Architect. Click on Create Data Object and create a layout that looks like this:

image

Call this data object “inventory”.

Next, we shall create a dashboard. Click on “Active Studio” on the home page. Click on “Create a new Report” and start with an empty layout. Then add a view and select Bar chart. The Bar Chart Edit panel opens up. Select the Inventory data object that you created. Next Group by “Warehouse ID” and “Product ID”. Select “Quantity” under chart values and Sum under “Summary Values”. Click Apply and Save the report.

Now that you have the report ready, we only need our refresh mechanism to update the data object. For this purpose, we create a SOA composite. Start Jdev and create a new SOA Project:

image image

Next, drag and drop a database adapter on the left side of the composite from the component palette

image

image image

Select the inventory table. Uncheck the “STATUS” column from the next step since this is not needed for the BAM Dashboard. This column will be updated by the adapter to “PROCESSED” once a row has been read. The trigger INVENTORY_MODIFIED will set STATUS column to  “MODIFIED” when a row is updated. This process is called “Logical Delete”. Refer to “Oracle Technology Adapters” Documentation for further details on Polling Strategies. This can be found on here - http://www.oracle.com/technology/products/ias/bpel/techpreview/index.html

image image image

Go with all default values and Finish.

Now we need to write to the BAM data object. For this purpose, we must create a new BAM connection. New –> Connections –> BAM Connection.

image image

Add the connection to “Application Resources”. If you create the connection under “Resource Palette”, then you must right-click and add the connection to the application. Once the connection is created, check to see if the Inventory data object shows up under the connection.

Next drag and drop a BAM adapter on the right side of the composite.

image

Click on Next and select the data object.

image

If BAM Connection doesn’t show up, you must add the BAM connection to your application.

Select UPSERT operation and click next. Select the primary key columns and shuttle them to the other side.

image

Click on Next until Finish. Now link both adapters to the mediator and create the XSL in the mediator. The XSL should look like this -

image

Save the project and deploy it on the server. Now enter values in the inventory table. In my case I have 3 Warehouses with the same set of products. The inventory levels are shown in the BAM dashboard. To open your BAM report, use the “Active Viewer”.

image

Comments:

interesting .. you can make reports relating to tables, but you can make any report related to one BPEL instance, if so, how BAM can be installed in my SOA?

Posted by Sanukode on May 21, 2009 at 12:35 PM PDT #

Thanks a lot for the short tutorial. Unfortunately when I try to do the same, from a list of records (e.g. from a DB table or flat file import) it only imports the first record into BAM. I check the transformation XSL and the output XML looks good (yes, I used the for-each statement). When I write the resulting XML into a DB Adapter instead of the BAM Adapter all required records result in the DB... Do you maybe have any ideas, what I could be doing wrong? Or do I adjust something in the BAM Adapter? Thanks a lot for your help, Bryan

Posted by Bryan on October 22, 2009 at 11:38 PM PDT #

Amazing!, it was a high excellent piece. Theoretically I would like to post like this too - taking time and real effort to create a useful written piece... yet , what can I say... I procrastinate a whole lot and don't seem to get something achieved

Posted by Annabel Fendrick on August 03, 2010 at 04:54 AM PDT #

I must claim, that in all the time I've spent using the net, analyzing blogs, forums, I never read one as short and snappy and well crafted as this one, I don't invariably comment on a blog though for you personally I felt the need to make an exception, it's without a doubt remarkable work and wholly opposite to the drivel, i spend a lot of my time on line, reading. Many thanks regarding taking the time and expending your effort to present your readers with a 1st class piece. I look forward to reading alot more of your work, once more thank you. Angie

Posted by Trey Burkhalter on August 05, 2010 at 10:26 AM PDT #

Do you have any links specifying how we integrate BAM with OSB 11g

Posted by sadha on September 02, 2010 at 07:18 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

bocadmin_ww

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today