Vous êtes sur la page 1sur 10

6/27/13

SOA 11g Tutorial: Business Activity Monitoring (BAM)

Jianming Li SOA 11g Tutorial: Business Activity Monitoring (BAM) (http://jianmingli.com/wp/?


p=2788)

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)
jianmingli.com/wp/?p=2788 1/10

6/27/13

SOA 11g Tutorial: Business Activity Monitoring (BAM)

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
O r d e rI DS t r i n g3 0C u s t o m e rI DS t r i n g3 0P r o d u c tN a m eS t r i n g5 0I t e mT y p e S t r i n g3 0P r i c eD e c i m a l1 0Q u a n t i t yD e c i m a l1 0S t a t u sS t r i n g5 0T o t a l C a l c u l a t e dP r i c e*Q u a n t i t yR e c e i v e dD a t eT i m e s t a m p

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

Define BAM Dashboard Open 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.
jianmingli.com/wp/?p=2788 2/10

6/27/13

SOA 11g Tutorial: Business Activity Monitoring (BAM)

* 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


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

6/27/13

SOA 11g Tutorial: Business Activity Monitoring (BAM)

* 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
m k d i r/ o p t / o r a c l e / M i d d l e w a r e / h o m e _ 1 1 g r 1 / O r a c l e _ S O A 1 / s o a / B A M P l a n

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: localhost InstanceName: ADCServer1 Password: welcome1 PortNumber: 9001 UserName: 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: localhost BAM Server Host: localhost User Name: weblogic Password: welcome1 HTTP Pot: 9001 JNDI Port: 9001
jianmingli.com/wp/?p=2788 4/10

6/27/13

SOA 11g Tutorial: Business Activity Monitoring (BAM)

* Click Next. * Click Test Connection.


T e s t i n gH T T Pc o n n e c t i o n. . .s u c c e s s .T e s t i n gD a t aO b j e c tb r o w s i n g. . . s u c c e s s .T e s t i n gJ N D Ic o n n e c t i o n. . .s u c c e s s .3o f3t e s t ss u c c e s s f u l .

* Click Finish.

Use BAM Adapter in POProcessing Add 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:
B A M S e r v e r C o n n e c t i o n 1>T r a i n i n g>P O P r o c e s s i n g>O r d e r s

- 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:
C u s t I D>_ C u s t o m e r _ I DI D>_ O r d e r _ I Dp r o d u c t N a m e>_ P r o d u c t _ N a m e i t e m T y p e>_ I t e m _ T y p eq u a n t i t y>_ Q u a n t i t ys t a t u s>_ S t a t u s

* Save all.

Test BAM Adapter Connection


* Redeploy POProcessing * Test with input message
< s o a p : E n v e l o p ex m l n s : s o a p = " h t t p : / / s c h e m a s . x m l s o a p . o r g / s o a p / e n v e l o p e / " > < s o a p : B o d yx m l n s : n s 1 = " h t t p : / / x m l n s . o r a c l e . c o m / n s / o r d e r " >
jianmingli.com/wp/?p=2788 5/10

6/27/13

SOA 11g Tutorial: Business Activity Monitoring (BAM)

< n s 1 : P u r c h a s e O r d e r >< n s 1 : C u s t I D > 1 1 1 1 < / n s 1 : C u s t I D >< n s 1 : I D > S M A L L 1 V A L I D < / n s 1 : I D >< n s 1 : p r o d u c t N a m e > i P o dS h u f f l e < / n s 1 : p r o d u c t N a m e > < n s 1 : i t e m T y p e > E l e c t r o n i c s < / n s 1 : i t e m T y p e >< n s 1 : p r i c e > 1 0 0 . 9 9 < / n s 1 : p r i c e > < n s 1 : q u a n t i t y > 3 < / n s 1 : q u a n t i t y >< n s 1 : s t a t u s > I n i t i a l < / n s 1 : s t a t u s > < n s 1 : c c T y p e > M a s t e r c a r d < / n s 1 : c c T y p e >< n s 1 : c c N u m b e r > 8 7 6 5 8 7 6 5 8 7 6 5 8 7 6 5 < / n s 1 : c c N u m b e r >< / n s 1 : P u r c h a s e O r d e r >< / s o a p : B o d y >< / s o a p : E n v e l o p e >

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 Process Set 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 on Monitor perspective. * Right click assignCCNumber icon and select "Create -> Sensors" to open the Create Activity Sensor 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 Sensor 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. * 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 Create Sensor Action dialog. - Action Name: PendingApprovalSensorAction
jianmingli.com/wp/?p=2788 6/10

6/27/13

SOA 11g Tutorial: Business Activity Monitoring (BAM)

- Sensor: PendingApprovalActivitySensor - Data Object: Training/POProcessing/Orders (Click magnifying glass and browse to BAMServerConnection1 -> Training -> POProcessing -> Orders) - Operation: Upsert - Keys: _Order_ID - Map File: bam\xsl\PendingApprovalSensorAction.xsl and map payload/variableData/data/Order to 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 Variable Sensor 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 Create Sensor Action dialog. - Action Name: CallbackSensorAction - Sensor: CallbackActivitySensor - Data Object: Training/POProcessing/Orders (Click magnifying glass and browse to BAMServerConnection1 -> Training -> POProcessing -> Orders) - Operation: Upsert - Keys: _Order_ID - Map File: bam\xsl\CallbackSensorAction.xsl and map payload/variableData/data/Order to Orders1Collection/_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:
< s o a p : E n v e l o p ex m l n s : s o a p = " h t t p : / / s c h e m a s . x m l s o a p . o r g / s o a p / e n v e l o p e / " > < s o a p : B o d yx m l n s : n s 1 = " h t t p : / / x m l n s . o r a c l e . c o m / n s / o r d e r " > < n s 1 : P u r c h a s e O r d e r >< n s 1 : C u s t I D > 1 1 1 1 < / n s 1 : C u s t I D >< n s 1 : I D > L A R G E 1 jianmingli.com/wp/?p=2788 7/10

6/27/13

SOA 11g Tutorial: Business Activity Monitoring (BAM)

I N V C C < / n s 1 : I D >< n s 1 : p r o d u c t N a m e > S t e r e o < / n s 1 : p r o d u c t N a m e > < n s 1 : i t e m T y p e > M u s i c < / n s 1 : i t e m T y p e >< n s 1 : p r i c e > 1 5 0 . 9 9 < / n s 1 : p r i c e > < n s 1 : q u a n t i t y > 5 0 < / n s 1 : q u a n t i t y >< n s 1 : s t a t u s > I n i t i a l < / n s 1 : s t a t u s > < n s 1 : c c T y p e > M a s t e r c a r d < / n s 1 : c c T y p e >< n s 1 : c c N u m b e r > 4 3 2 1 4 3 2 1 4 3 2 1 4 3 2 1 < / n s 1 : c c N u m b e r >< / n s 1 : P u r c h a s e O r d e r >< / s o a p : B o d y >< / s o a p : E n v e l o p e >

* 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:
L A R G E 1 I N V C C1 1 1 1S t e r e oM u s i c1 5 0 . 9 95 07 , 5 4 9 . 5i n v a l i d C r e d i t C a r d

Test Large Order


* Test with input message that has order larger than 5000 and valid credit card:
< s o a p : E n v e l o p ex m l n s : s o a p = " h t t p : / / s c h e m a s . x m l s o a p . o r g / s o a p / e n v e l o p e / " > < s o a p : B o d yx m l n s : n s 1 = " h t t p : / / x m l n s . o r a c l e . c o m / n s / o r d e r " > < n s 1 : P u r c h a s e O r d e r >< n s 1 : C u s t I D > 1 1 1 1 < / n s 1 : C u s t I D >< n s 1 : I D > L A R G E 1 V A L C C < / n s 1 : I D >< n s 1 : p r o d u c t N a m e > S t e r e o < / n s 1 : p r o d u c t N a m e > < n s 1 : i t e m T y p e > M u s i c < / n s 1 : i t e m T y p e >< n s 1 : p r i c e > 1 5 0 . 9 9 < / n s 1 : p r i c e > < n s 1 : q u a n t i t y > 5 0 < / n s 1 : q u a n t i t y >< n s 1 : s t a t u s > I n i t i a l < / n s 1 : s t a t u s > < n s 1 : c c T y p e > M a s t e r c a r d < / n s 1 : c c T y p e >< n s 1 : c c N u m b e r > 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 < / n s 1 : c c N u m b e r >< / n s 1 : P u r c h a s e O r d e r >< / s o a p : B o d y >< / s o a p : E n v e l o p e >

* Open Active Viewer and check that new order is shown on the ordered list with a status of "Pending Approval".
L A R G E 1 V A L C C1 1 1 1S t e r e oM u s i c1 5 0 . 9 95 07 , 5 4 9 . 5P e n d i n gA p p r o v a l

* Log into Worklist application to approve the order. * Check that order status is changed to "Approved".
L A R G E 1 V A L C C1 1 1 1S t e r e oM u s i c1 5 0 . 9 95 07 , 5 4 9 . 5a p p r o v e d

Issues Cannot Find Sensor Tab


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

6/27/13

SOA 11g Tutorial: Business Activity Monitoring (BAM)

* 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 on Monitor 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 Number E14138-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
jianmingli.com/wp/?p=2788 9/10

6/27/13

SOA 11g Tutorial: Business Activity Monitoring (BAM)

Join the discuss

... on Topic

(#) Submit

CAPTCHA Code *

Include a Page in WordPress Post (http://jianmingli.com/wp/?p=2839) || SOA 11g Tutorial: Service Data Objects (SDO) (http://jianmingli.com/wp/?p=2838) Top 2013,Jianming Li,WP Theme "mts journey" by mts from WebDesign.

jianmingli.com/wp/?p=2788

10/10

Vous aimerez peut-être aussi