Sunday, May 19, 2013

Using Oracle BAM Data Control-ADF Web Application


Oracle BAM data control is a binding component in the Oracle ADF Model with support for Active Data Services. Oracle BAM data control allows ADF developers to build applications with a dynamic user interface that changes based on real-time business events. Oracle BAM data control is used to bind data from Oracle BAM data objects to databound UI components in an ADF page.
Oracle BAM data control abstracts a query on Oracle BAM data objects using standard metadata interfaces to describe the Oracle BAM data collections. Using JDeveloper, you can view that information as icons which you can drag and drop onto a page. Using those icons, you can create databound UI components (for JSF JSP pages) by dragging and dropping them from the Data Controls panel onto the visual editor for a page. JDeveloper automatically creates the metadata that describes the bindings from the page to the Oracle BAM data objects. At runtime, the ADF Model layer reads the metadata information from appropriate XML files for both the data controls and bindings and implements the connection between your user interface and Oracle BAM data objects. Note that Oracle BAM data control is read-only.

Creating Projects using BAM DC


Oracle BAM data control must to be hosted by a valid ADF web application. Also, a limited set of ADF Faces components support active data, therefore a limited set of ADF Faces components can make use of the main functionality of an Oracle BAM data control.
Oracle BAM data control requires that the project contain the ADF Faces and ADF Page Flow technologies. The Fusion Web Application (ADF) template in JDeveloper contains these technologies.

Creating BAM Server Connection


You must create a connection to Oracle BAM to browse the available data objects in JDeveloper. This connection information is automatically used during deployment and runtime.
Fallowing Steps describes about Creating BAM Server Connection in JDeveloper. Create a connection to an Oracle BAM Server to browse data objects available on that server.
  1. In JDeveloper, from File menu click New.


  1. From the General category, choose Connections and from Items select BAM Connection


  1. Click ok

  1. Ensure that Application Resources is selected, provide a name for the connection as BAMServerConnectionPO and click Next.



  1. Enter the connection information about the Oracle BAM Server host.



BAM Web Host: localhost.
BAM Sarver Host: localhost
User Name:Enter the Oracle BAM Server user name (weblogic).
Password: Enter the Password of user name (welcome1).
HTTP Port: 9001
JNDI Port: 9001
Uses HTTPS: uncheck

  1. Click Next.

  1. Test the connection use Test Connection button; if the connection was successful, the following message appears in wizard.


  1. Once test was successful click Finish.

Exposing Oracle BAM with Oracle ADF Data Controls

Once you have created your Oracle BAM data objects and established a connection to an Oracle BAM server from JDeveloper, you can use JDeveloper to create data controls that provide the information needed to declaratively bind UI components to those data objects.

  1. Create Generic Application in JDeveloper.
Application Name as Test_bam
Package as com.techdemo.bam
Project name as Test_bam
Select technologies as ADF Business Components and ADF Faces.

  1. Once Test_bam Created in JDeveloper Application Navigator will be look like as below diagram.


  1. Ensure that BAM Server connection is there are not for this application if not create a BAM Server connection.(if connection was created you’re able to see BAM serverConnection under  Application Resources)  



  1. In the Application Navigator, Application Resources panel, expand the data object folders in the Oracle BAM Server connection.

  1. Right-click the Oracle BAM data object for which you want to create a data control, and select Create Data Control from the context menu.

  1. Here create Data Control for BAM_Composite_DO Data Object


  1. Complete the BAM Data Control wizard to create the data control query.

In Create BAM Data Control Wizard Name step
Bam Data Control name: default
Directory name: default
Query Type: select   Group Query
Check collapse
New records position: at the beginning   

  1. Click Next.



  1. Click Add to add a parameter.Click the Add icon above and to the right of the Parameters box. Name as myparameter and check Enable Default Value select ALL.
  2. Click Next.

  1. From Calculation step  from Insert Expression select Sum  and click on the same,
Same as select Total Amount from Insert Field, from Group By select CustID using popup then click OK.

  1. Click pencil icon to rename calculation1 to mycalculation  click Ok
 

  1. Click Ok from Calculated Filed step.

  1. From Groups step of BAM Data Control. Select all fields. And then click next.


  1. Skip Aggregates, click next.


  1. Skip Filters, click Finish.

  1. After Finishing BAM Data Control Wizard. You’re able to see BAM_Composite_DO in Data Control of JDeveloper.

Using Oracle BAM Data Controls in ADF Pages

Oracle BAM data controls can be used in all ADF Faces components. Only subsets of ADF Faces components are ADS (active data service) capable.
  1. Right Click on Test_bam project, select new from context menu.

 

  1. New Gallery opened one you click on. Select   Current  Project Technologies tab
Select JSF from Web Tier of Categories side and select JSF page from Items side then click OK.

   

  1. Now Create JSF Page Wizard will be shown as be low diagram.
Rename File Name as Test
Check create as XML Document (*.jspx)
From page template select oracle three column layouts
Click ok.

  1. After you done creation of JSF page, test.jspx page will be opened in Editor Mode in JDeveloper


  1. Remove End facet from test.jspx page, right click on End facet the from context menu click  on Delete option


  1. From Component panel drag and drop Panel Splitter into test.jspx page of center facet.


  1. In Panel Splitter of Property Inspector change the Orientation as Vertical from Common.



  1. From Data controls expand BAM_Composite_DO select Query, drag and drop to first facet of the page.

  1. After drop Query component in to First facet, it show context menu select ADF Read-only table… from Table.


  1. This will be shown Edit Tables Columns Wizard check Enable sorting  and  enable Filtering  then click ok.



  1. Read-only table will be shown in page as like below diagram.


  1. Same way drag and drop Query component on second facet of page and select Graph from context menu.


  1. It will show Component Gallery select Pie from categories the click OK.


  1. It will show Create Pie Graph Wizard, select id from pie and select _custID ,_orderID from Slices. Then click OK.

  1. After creating both the page should like as below diagram.


  1. Right Click on the test.jspx page or from application navigator Right click on  test.jspx page  click on RUN.


  1. After successfully run the application you can able to see the ADF UI page in Browse
This will show Data from BAM Data Objects like in BAM Active Studio reports.


  1. So that we can create web application from Oracle BAM Data Controls in JDeveloper
Using Oracle ADF.

 

No comments:

Post a Comment