soa 11g tutorial_ business activity monitoring (bam)

10
6/27/13 SOA 11g Tutorial: Business Activity Monitoring (BAM) jianmingli.com/wp/?p=2788 1/10 Contents Define Data Object (#Define_Data_Object) Login BAM Console (#Login_BAM_Console) Create Subfolders (#Create_Subfolders) Create Data Objects (#Create_Data_Objects) Define BAM Dashboard (#Define_BAM_Dashboard) Open Active Studio (#Open_Active_Studio) Create Report Folders (#Create_Report_Folders) Create a New Report (#Create_a_New_Report) Configure Top Tile (#Configure_Top_Tile) Configure Lower Left Tile (#Configure_Lower_Left_Tile) Configure Lower Right Tile (#Configure_Lower_Right_Tile) Save Report (#Save_Report) Configure BAM Adapter on WebLogic Server (#Configure_BAM_Adapter_on_WebLogic_Server) Create BAM Plan Directory (#Create_BAM_Plan_Directory) Configure BAM Adapter (#Configure_BAM_Adapter) Redeploy BAM Adapter (#Redeploy_BAM_Adapter) Add BAM Connection to POProcessing (#Add_BAM_Connection_to_POProcessing) Use BAM Adapter in POProcessing (#Use_BAM_Adapter_in_POProcessing) Add BAM Adapter to POProcessing (#Add_BAM_Adapter_to_POProcessing) Connect Mediator Component to BAM Adapter (#Connect_Mediator_Component_to_BAM_Adapter) Test BAM Adapter Connection (#Test_BAM_Adapter_Connection) Check Data Object Contents (#Check_Data_Object_Contents) Add BAM Sensors to BPEL Process (#Add_BAM_Sensors_to_BPEL_Process) Set Order Status to 'Pending Approval' (#Set_Order_Status_to_Pending_Approval) Add sensor: PendingApprovalActivitySensor (#Add_sensor:_PendingApprovalActivitySensor) Add sensor action: PendingApprovalSensorAction (#Add_sensor_action:_PendingApprovalSensorAction) Add sensor: CallbackActivitySensor (#Add_sensor:_CallbackActivitySensor) Add sensor action: CallbackSensorAction (#Add_sensor_action:_CallbackSensorAction) Test BPEL Sensors (#Test_BPEL_Sensors) Test Large Order (#Test_Large_Order) Issues (#Issues) Cannot Find Sensor Tab (#Cannot_Find_Sensor_Tab) Jianming Li SOA 11g Tutorial: Business Activity Monitoring (BAM) (http://jianmingli.com/wp/? p=2788)

Upload: veeru-mudiraj

Post on 30-Nov-2015

43 views

Category:

Documents


1 download

DESCRIPTION

soa

TRANSCRIPT

Page 1: SOA 11g Tutorial_ Business Activity Monitoring (BAM)

6/27/13 SOA 11g Tutorial: Business Activity Monitoring (BAM)

jianmingli.com/wp/?p=2788 1/10

Contents

Define Data Object (#Define_Data_Object)

Login BAM Console (#Login_BAM_Console)

Create Subfolders (#Create_Subfolders)

Create Data Objects (#Create_Data_Objects)

Define BAM Dashboard (#Define_BAM_Dashboard)

Open Active Studio (#Open_Active_Studio)

Create Report Folders (#Create_Report_Folders)

Create a New Report (#Create_a_New_Report)

Configure Top Tile (#Configure_Top_Tile)

Configure Lower Left Tile (#Configure_Lower_Left_Tile)

Configure Lower Right Tile (#Configure_Lower_Right_Tile)

Save Report (#Save_Report)

Configure BAM Adapter on WebLogic Server (#Configure_BAM_Adapter_on_WebLogic_Server)

Create BAM Plan Directory (#Create_BAM_Plan_Directory)

Configure BAM Adapter (#Configure_BAM_Adapter)

Redeploy BAM Adapter (#Redeploy_BAM_Adapter)

Add BAM Connection to POProcessing (#Add_BAM_Connection_to_POProcessing)

Use BAM Adapter in POProcessing (#Use_BAM_Adapter_in_POProcessing)

Add BAM Adapter to POProcessing (#Add_BAM_Adapter_to_POProcessing)

Connect Mediator Component to BAM Adapter (#Connect_Mediator_Component_to_BAM_Adapter)

Test BAM Adapter Connection (#Test_BAM_Adapter_Connection)

Check Data Object Contents (#Check_Data_Object_Contents)

Add BAM Sensors to BPEL Process (#Add_BAM_Sensors_to_BPEL_Process)

Set Order Status to 'Pending Approval' (#Set_Order_Status_to_Pending_Approval)

Add sensor: PendingApprovalActivitySensor (#Add_sensor:_PendingApprovalActivitySensor)

Add sensor action: PendingApprovalSensorAction(#Add_sensor_action:_PendingApprovalSensorAction)

Add sensor: CallbackActivitySensor (#Add_sensor:_CallbackActivitySensor)

Add sensor action: CallbackSensorAction (#Add_sensor_action:_CallbackSensorAction)

Test BPEL Sensors (#Test_BPEL_Sensors)

Test Large Order (#Test_Large_Order)

Issues (#Issues)

Cannot Find Sensor Tab (#Cannot_Find_Sensor_Tab)

Jianming Li

SOA 11g Tutorial: Business Activity Monitoring (BAM) (http://jianmingli.com/wp/?p=2788)

Page 2: SOA 11g Tutorial_ Business Activity Monitoring (BAM)

6/27/13 SOA 11g Tutorial: Business Activity Monitoring (BAM)

jianmingli.com/wp/?p=2788 2/10

This is part of the Oracle SOA11g hands on tutorials (?p=1924).

Define Data Object

* Define data object to hold event data.

Login BAM Console

* Login in BAM using IE (NOT Firefox): http://localhost:9001/OracleBAM (http://localhost:9001/OracleBAM)

- User name: weblogic- Password: welcome1

Create Subfolders

* Click on Architect button to open the Architect application page.* In the upper left corner "Folders" pane, click the Data Objects folder.* In the right side pane, click Create Subfolder link.* Enter Training and click Create Folder button.* Click Continue button.* Create another subfolder named POProcessing within the newly created Training folder.

Create Data Objects

* Click POProcessing folder on the "Folders" pane.* In the right pane, click Create Data Object link.- Name for new Data Object: Orders- Tip text: Orders* Click Add a field link to add the following fields

Order ID String 30 Customer ID String 30 Product Name String 50 Item Type

String 30 Price Decimal 10 Quantity Decimal 10 Status String 50 Total

Calculated Price * Quantity Received Date Timestamp

* Click Create Data Object button.* Click Continue button.

Define BAM DashboardOpen Active Studio

* Go back to the BAM welcome page, i.e. first page after logging in.* Click Active Studio link to open BAM Active Studio application page.* Click Shared Reports tab so we can create a report everyone can view.

Create Report Folders

* Click Create a new folder link in Organize pane named Training.* Double click newly created Training folder to open it.* Click Create a new folder link in Organize pane again to create a subfolder named POProcessing.

Page 3: SOA 11g Tutorial_ Business Activity Monitoring (BAM)

6/27/13 SOA 11g Tutorial: Business Activity Monitoring (BAM)

jianmingli.com/wp/?p=2788 3/10

* Double click POProcessing folder to open.

Create a New Report

* Click Create A New Report button.* Select "Three tiles with horizontal tile on the top and two square tiles on the bottom" layout.* Name the report POProcessing Report by "Click to add a report title" on title bar.

Configure Top Tile

* On the top tile, click Updating Ordered List icon.* On the Choose Data Object dialog,- Double click Training folder- Double click POProcessing folder- Select Orders- Click Next button- Click Select All to the right of Data Fields.- Rearrange data fields with the up and down arrow.- Click Next and Finish.

Configure Lower Left Tile

* Select 3D Pie Chart.* Select Orders as data object.* Select Item Type data field as Group By option.* Select Total data field as Chart Values option.* Select Percentage of Total as Summary Function option.* Click Next.* Click Change View Properties.* Set View Title to Percentage of Total Sales by Item Type.* Click OK.

Configure Lower Right Tile

* Select 3D Bar Chart.* Select Orders as data object.* Select Status data field as Group By option.* Select Order ID field as Chart Values.* Select Count as Summary Function(s).* Click Next.* Click Change View Properties.* Set View Title to Purchase Orders by Status.* Click OK.

Save Report

* Click Save Report link under Actions pane.* Choose Shared Reports/Training/POProcessing subfolder* Accept default report name of POProcessing Report.* Click OK button.

Configure BAM Adapter on WebLogic Server

Page 4: SOA 11g Tutorial_ Business Activity Monitoring (BAM)

6/27/13 SOA 11g Tutorial: Business Activity Monitoring (BAM)

jianmingli.com/wp/?p=2788 4/10

* BAM adapter is used to send events to data object from POProcessing composite.

Create BAM Plan Directory

* Create BAM plan directory on BAM server machine

mkdir /opt/oracle/Middleware/home_11gr1/Oracle_SOA1/soa/BAMPlan

Configure BAM Adapter

* Login WebLogic Admin Console (http://localhost:7001/console/login/LoginForm.jsp(http://localhost:7001/console/login/LoginForm.jsp)).* Click Deployments in Domain Structure pane.* Search and click OralceBamAdapter.* Click on Configuration tab.* Click on Outbound Connection Pools sub-tab.* Expand oracle.bam.adapter.adc.RMIConnectionFactory.* Click eis/bam/rmi.* Enter following values (note, you need to hit enter key after enter a value):HostName: localhostInstanceName: ADCServer1Password: welcome1PortNumber: 9001UserName: weblogic* Click Save button. Use newly created path as plan path:Path: /opt/oracle/Middleware/home_11gr1/Oracle_SOA1/soa/BAMPlan/Plan.xml* Click OK.

Redeploy BAM Adapter

* Click Deployments in Domain Structure pane.* Search and select OralceBamAdapter.* Click Update button.* Accept the default selections and click Finish button.* Check that BAM Adapter is depployed on bam_server1 server instance.

Add BAM Connection to POProcessing

* Open JDeveloper* Open POProcessing application* Right click POProcessing application and select New...* Select General -> Connections -> BAM Connection and click OK.* Accept default name of BAMServerConnection1 and click Next.* Enter connection values:BAM Web Host: localhostBAM Server Host: localhostUser Name: weblogicPassword: welcome1HTTP Pot: 9001JNDI Port: 9001

Page 5: SOA 11g Tutorial_ Business Activity Monitoring (BAM)

6/27/13 SOA 11g Tutorial: Business Activity Monitoring (BAM)

jianmingli.com/wp/?p=2788 5/10

* Click Next.* Click Test Connection.

Testing HTTP connection ... success. Testing Data Object browsing ...

success. Testing JNDI connection ... success. 3 of 3 tests successful.

* Click Finish.

Use BAM Adapter in POProcessingAdd BAM Adapter to POProcessing

* Open POProcessing composite.xml file.* Drag and drop BAM Adapter onto External References.* On Adapter Configuration Wizard dialogs,- Click Next on Welcome screen- Enter OrdersBAMAdapter as service name.- Browse and select Orders as data object:

BAMServerConnection1 -> Training -> POProcessing -> Orders

- Select Operation: Upsert- Opeation Name: writetoBAM- Enable Batching: selected- Selected: _Order_ID- JNDI Name: eis/bam/rmi

Connect Mediator Component to BAM Adapter

* Wire routePO mediator component to newly added BAM adapter.* Double click routePO mediator component to open the routePO.mplan file.* Click the transform icon for BAM adapter and create a new mapper file:

CustID -> _Customer_ID ID -> _Order_ID productName -> _Product_Name

itemType -> _Item_Type quantity -> _Quantity status -> _Status

* Save all.

Test BAM Adapter Connection

* Redeploy POProcessing* Test with input message

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

<soap:Body xmlns:ns1="http://xmlns.oracle.com/ns/order">

Page 6: SOA 11g Tutorial_ Business Activity Monitoring (BAM)

6/27/13 SOA 11g Tutorial: Business Activity Monitoring (BAM)

jianmingli.com/wp/?p=2788 6/10

<ns1:PurchaseOrder> <ns1:CustID>1111</ns1:CustID> <ns1:ID>SMALL1-

VALID</ns1:ID> <ns1:productName>iPod Shuffle</ns1:productName>

<ns1:itemType>Electronics</ns1:itemType> <ns1:price>100.99</ns1:price>

<ns1:quantity>3</ns1:quantity> <ns1:status>Initial</ns1:status>

<ns1:ccType>Mastercard</ns1:ccType> <ns1:ccNumber>8765-8765-8765-

8765</ns1:ccNumber> </ns1:PurchaseOrder> </soap:Body> </soap:Envelope>

Check Data Object Contents

* Log into BAM console.* Click Architect to open Architect application.* In Folders pane, click Data Objects -> Training -> POProcessing folder.* In Data Objects pane, click DataOrders.* In right pane, click contents link.* Check that Orders data object contains data rows.

Add BAM Sensors to BPEL ProcessSet Order Status to 'Pending Approval'

* Open JDev.* Open POProcessing composite.xml file.* Double click approveLargeOrder BPEL component to open it.* Double click assignCCNumber activity to open it.* Copy 'Pending Approval' (with single quotes) to the status field of the Order output Variable(ouputVariable/payload//ns2:Order/ns2:status).

Add sensor: PendingApprovalActivitySensor

* On the upper right corner of editor pane, click Monitor button next to the BPEL button to turn onMonitor perspective.* Right click assignCCNumber icon and select "Create -> Sensors" to open the Create ActivitySensor dialog.- Name: PendingApprovalActivitySensor- Activity Name: assignCCNumber- Evaluation Time: Completion* Click the green plus sign in Activity Variable Sensors pane to open the Create Activity Variable Sensordialog.- Variable XPath: $outputVariable/payload/ns2:Order- Output Namespace: http://xmlns.oracle.com/ns/order- Output Datatype: OrderType* Click OK to close Create Activity Sensor dialog.* Notice that assignCCNumber activity icon has a new sensor icon in it.

Add sensor action: PendingApprovalSensorAction

* With approveLargeOrder.bpel file open, open Structure panel (View -> Structure)* Right click Sensor Actions folder and select Create -> BAM Sensor Action... to open the CreateSensor Action dialog.- Action Name: PendingApprovalSensorAction

Page 7: SOA 11g Tutorial_ Business Activity Monitoring (BAM)

6/27/13 SOA 11g Tutorial: Business Activity Monitoring (BAM)

jianmingli.com/wp/?p=2788 7/10

- Sensor: PendingApprovalActivitySensor- Data Object: Training/POProcessing/Orders (Click magnifying glass and browse toBAMServerConnection1 -> Training -> POProcessing -> Orders)- Operation: Upsert- Keys: _Order_ID- Map File: bam\xsl\PendingApprovalSensorAction.xsl and map payload/variableData/data/Orderto Orders1Collection/_Orders.- BAM Connection Factory JNDI: eis/bam/rmi- Enable Batching: checked* Click OK.

Add sensor: CallbackActivitySensor

* Right click callbackClient invoke activity at the end of BPEL process. Select Create -> Sensor...- Name: CallbackActivitySensor- Evaluation Time: Activation* Click the green plus sign in Activity Variable Sensors pane to open the Create Activity VariableSensor dialog.- Variable XPath: $outputVariable/payload/ns2:Order- Output Namespace: http://xmlns.oracle.com/ns/order- Output Datatype: OrderType* Click OK to close Create Activity Sensor dialog.

Add sensor action: CallbackSensorAction

* With approveLargeOrder.bpel file open, open Structure panel (View -> Structure)* Right click Sensor Actions folder and select Create -> BAM Sensor Action... to open the CreateSensor Action dialog.- Action Name: CallbackSensorAction- Sensor: CallbackActivitySensor- Data Object: Training/POProcessing/Orders (Click magnifying glass and browse toBAMServerConnection1 -> Training -> POProcessing -> Orders)- Operation: Upsert- Keys: _Order_ID- Map File: bam\xsl\CallbackSensorAction.xsl and map payload/variableData/data/Order toOrders1Collection/_Orders.- BAM Connection Factory JNDI: eis/bam/rmi- Enable Batching: checked* Click OK.* Save all.

Test BPEL Sensors

* Redeploy POProcessing.* Test with input message that contains invalid credit card number:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

<soap:Body xmlns:ns1="http://xmlns.oracle.com/ns/order">

<ns1:PurchaseOrder> <ns1:CustID>1111</ns1:CustID> <ns1:ID>LARGE1-

Page 8: SOA 11g Tutorial_ Business Activity Monitoring (BAM)

6/27/13 SOA 11g Tutorial: Business Activity Monitoring (BAM)

jianmingli.com/wp/?p=2788 8/10

INVCC</ns1:ID> <ns1:productName>Stereo</ns1:productName>

<ns1:itemType>Music</ns1:itemType> <ns1:price>150.99</ns1:price>

<ns1:quantity>50</ns1:quantity> <ns1:status>Initial</ns1:status>

<ns1:ccType>Mastercard</ns1:ccType> <ns1:ccNumber>4321-4321-4321-

4321</ns1:ccNumber> </ns1:PurchaseOrder> </soap:Body> </soap:Envelope>

* Log into BAM console* Start Active Viewer application.* Click Select Report and select POProcessing Report* Notice that new purchase order is shown on the ordered list with status of invalidCreditCard:

LARGE1-INVCC 1111 Stereo Music 150.99 50 7,549.5 invalidCreditCard

Test Large Order

* Test with input message that has order larger than 5000 and valid credit card:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

<soap:Body xmlns:ns1="http://xmlns.oracle.com/ns/order">

<ns1:PurchaseOrder> <ns1:CustID>1111</ns1:CustID> <ns1:ID>LARGE1-

VALCC</ns1:ID> <ns1:productName>Stereo</ns1:productName>

<ns1:itemType>Music</ns1:itemType> <ns1:price>150.99</ns1:price>

<ns1:quantity>50</ns1:quantity> <ns1:status>Initial</ns1:status>

<ns1:ccType>Mastercard</ns1:ccType> <ns1:ccNumber>1234-1234-1234-

1234</ns1:ccNumber> </ns1:PurchaseOrder> </soap:Body> </soap:Envelope>

* Open Active Viewer and check that new order is shown on the ordered list with a status of"Pending Approval".

LARGE1-VALCC 1111 Stereo Music 150.99 50 7,549.5 Pending Approval

* Log into Worklist application to approve the order.* Check that order status is changed to "Approved".

LARGE1-VALCC 1111 Stereo Music 150.99 50 7,549.5 approved

IssuesCannot Find Sensor Tab

Page 9: SOA 11g Tutorial_ Business Activity Monitoring (BAM)

6/27/13 SOA 11g Tutorial: Business Activity Monitoring (BAM)

jianmingli.com/wp/?p=2788 9/10

* Since JDev 11.1.1.2, all monitor features have been moved into a new perspective call "Monitor".Click the Monitor button next to the BPEL button on the upper right corner of the editor pane to turn onMonitor perspective.

References

*

Getting Started With

Oracle SOA Suit...

Heidi Buelow, Mana...

Best Price $41.90

or Buy New $53.99

Privacy Information

* Oracle Fusion Middleware Release 1 (11.1.1.4) Document Library(http://download.oracle.com/docs/cd/E17904_01/index.htm)

* Oracle Fusion Middleware List of Books 11g Release 1 (11.1.1.4.0)(http://download.oracle.com/docs/cd/E17904_01/nav/portal_booklist.htm)

* SOA 11g Documentation page(http://www.oracle.com/technetwork/middleware/soasuite/documentation/index.html)

* WebLogic 11.1.1.4 Documentation (http://download.oracle.com/docs/cd/E17904_01/wls.htm)

* http://download.oracle.com/docs/cd/E12839_01/soa.htm(http://download.oracle.com/docs/cd/E12839_01/soa.htm)

* Oracle® Fusion Middleware Domain Template Reference 11g Release 1 (10.3.4) Part NumberE14138-07 (http://download.oracle.com/docs/cd/E17904_01/web.1111/e14138/toc.htm)

* Oracle Learning Library (http://apex.oracle.com/pls/apex/f?p=44785:1:3564148054738526)

Let us talk about

Name and Mail are required

Name

Mail(will not be published)

Website

Page 10: SOA 11g Tutorial_ Business Activity Monitoring (BAM)

6/27/13 SOA 11g Tutorial: Business Activity Monitoring (BAM)

jianmingli.com/wp/?p=2788 10/10

Join the discuss

... on Topic

(#) CAPTCHA Code *

Submit

« Include a Page in WordPress Post (http://jianmingli.com/wp/?p=2839) || SOA 11g Tutorial: Service DataObjects (SDO) (http://jianmingli.com/wp/?p=2838) »

Top

© 2013,Jianming Li,WP Theme "mts journey" by mts from WebDesign.