Saturday, March 23, 2013

BPEL Process Monitoring Objects through Oracle BAM

BPEL process configurable monitoring objects are available in three types:
  • Counters.
  • Intervals. 
  •  Business Indicators.

Configuring Counters

   Every time the BPEL process passes a snapshot of a Counter (which is attached to an activity in the BPEL process diagram), data is sent to Oracle BAM. The Counter indicates how often a BPEL activity is encountered, and creates a new record in an Oracle BAM data object with time data.
1.       Open ApproveLargeOrder BEPL in JDeveloper.
2.       Right Click on receiveInput activity    select Create, Choose a monitoring object type as Counter from the list.


3.       Use counter Dialog to create a Counter monitoring object. Mention Name as AllInputs, check Enable, in Snapshots section select ReceiveInput for Activity Name.

4.       Choose an evaluation event (an event within the activity), by clicking the browsing icon.
5.       The Evaluation Event Chooser opens to let you select one or more evaluation events then click ok twice.
6.       When the Counter snapshot configuration is complete, it is displayed as an N icon next to activity in the BPEL process diagram.

7.       The Counter and its snapshot are represented in the structure pane also.

8.       Once you done all these steps of configure counters, save the composite uses save all option from JDeveloper toolbar.  

Configure Intervals

                An Interval monitoring object captures the amount of time to go from one activity to another in the BPEL process. The start and end times are captured and sent to an Oracle BAM data object.
  1. To create Interval monitoring object you can use any one way out of there ways to create a  monitoring object.
2. In BEPL Editor right click on select Create  choose Interval monitoring  object
   3.       Use the Interval dialog to configure an Interval monitoring object.

a.       The Enabled checkbox enables or disables this particular monitoring object.

b.      The Start Activity defines the beginning of the Interval. Select a Start Activity from the list as assignCCNumber.


c.       End Activity defines the end of the Interval. Select an End Activity from the list as callBackClient.

d.      You can select Associated Indicators if a Business Indicator has been previously defined in the BPEL process. Selecting an associated indicator automatically provides two snapshots on the selected Business Indicator. This captures the Business Indicator metrics at the start and at the end of the Interval.
  4.       Click Ok to complete Interval monitoring object wizard.
   5.       Once you done! You able to see MainFlow interval object in structure plane.
   6.        Finally save the composite.

Configure Business Indicators

A Business Indicator monitoring object captures a snapshot of BPEL variables, specified by the metrics in the Business Indicator, or evaluates expressions, when the events specified in the Business Indicator are encountered in the BPEL process.
  1.      To create Business Indicator you can use any one way out of there ways to create a monitoring  object. From ApprovalLargeOrder bple click Monitoring .
2. In apprevellargeOrder.bpel click create Monitoring object icon from header of BPEL. As shown in diagram.
         
          
 3 Now it will show the Business Indicator dialog box by clicking Green plus Icon add business Indicator.

4.       Now go to Structure  panel of BPLE select Business Indicator  click on pencil like icon for Editing.

      5.        It will show the Business Indicator dialog. 
      Name as PriceIndicator
   From Metric use green plus icon to add Metric


  6.       In Metric change name as Price Data Type to decimal and select XPath as below diagram using search.

  7.       After Entering all above details the Diagram look like as below.

  8.       Now add Business Indicator to right click on  assigeCCNumber add Business Indicator.


    9.       This will show the available business Indicator in dialog select PriceIndicator the click ok.


   10.   Now observer BPEL at assigneeCCNumber  Business Indicator icon will be appear.
 

   11.   Click on that Indicator  this will show  Activity Business Indicator dialog the select  PriceIndicator


   12.   The priceIndicator will opened Business indicator   as shown below diagram. From that select and From Evaluation Events select Browse. 


   13.   In Evaluation Event Chooser check activates and complete   then click OK.
   14.   After setting all Indicators the Business Indicator will be look like.

   15.   Click ok Twice for all Business Indicators.

   16.   Save the Composite close the BPEL Process. 

Configure BPEL Process Monitors for Deployment

   1.       In the Application Navigator project folder, open the  monitor.config  file for editing.
   2.       The monitor.config file defines deployment and runtime properties needed to connect with Oracle BAM Server to create and populate the data objects
  3.       The default monitor.config file is shown in the following example.
<?xml version="1.0" encoding="UTF-8"?>
<MonitorConfig>
  <Connection>
    <BAM dataObjectsFolder="/Samples/Monitor Express/"
         adapterConnectionFactoryJNDI="eis/bam/rmi" batch="true"
         deploymentProtocol="http"></BAM>
  </Connection>
  <Deployment ignoreErrors="true"/>
</MonitorConfig>
2.       Deploy PoProcessing Application to SOA server (as u did in your Po Processing application deployment).

Testing the Application 

Testing Application here is you configures Express Monitoring in BPEL and configured monitoring objects.
    1.       Open em console where PO Processing application is running.


    2.       After logged in navigate to PO Processing application from SOA domain click on PO processing.


   3.       Once PO Processing composite Opened click on Test button to test the services.

   4.       Provide input as xml formate  as you did for PO Processing application time.here provide input  from file po-large-iPodx30.txt

    5.       After provide input click on TestWebservices button.

   6.       After successfully test, you can see test status as Request successfully received.


   7.       Use internet Explorer Browser to login Oracle BAM.
   8.       Enter credentials of Oracle BAM server
Username: weblogic(or match with user configurations) .
Password: welcome1 (or match with user configurations)

    9.       Once you successfully login, able to see the Oracle BAM server console like below diagram.  



    10.   For observing Data Objects created by Express Monitoring click on Architect tab.
    11.   In  BAM Architect page  navigate to Data Objectsà Samples  then click on Express Monitoring 
In Data Objects of Express Monitoring you can able to see COMPONENT, COUNTER, and INTERVAL Data Objects which is created by monitoring option.

   12.   Now click on COMPONENT Data Object.


  13.   Right side of COMPONENT Data Object click on Content, you’re able to see content Component Data.   


   14.   Same way can also to see for COUNTER Data objects contents also which you configure at the time of Counter configuration.

How many Orders/requests are received to receive input activity?
    
  

  15.   As Same as Interval Data Objects also.
As for Business Indicator will create BI_PO_POPROCESSING_APPROVELARGEORDER Data Object in Express Monitoring folder. You can see content as same above.

Saturday, March 9, 2013

SOA Composite Applications Monitoring using Oracle BAM

The Oracle BAM Adapter is a Java Connector Architecture (JCA)-compliant adapter that can be used from a Java EE client to send data and events to the Oracle BAM Server. The Oracle BAM Adapter supports the following operations on Oracle BAM data objects: inserts, updates, upserts, and deletes.
            The Oracle BAM Adapter can perform these operations over Remote Method Invocation (RMI) calls (if they are deployed in the same farm), direct Java object invocations (if they are deployed in the same container), or over Simple Object Access Protocol (SOAP) (if there is a fire wall between them).
Oracle BAM Adapter can be used with various features in SOA composite applications by which you can send data to an Oracle BAM Server:
1.      The Oracle BAM Adapter transfers data from BPEL process monitors to automatically generated Oracle BAM data objects (Monitor Express).
2.      The Oracle BAM Adapter can be used as a reference binding component in a SOA composite application. For example, Oracle Mediator can send data to Oracle BAM using the Oracle BAM Adapter
3.      The Oracle BAM Adapter can also be used as a partner link in a Business Process Execution Language (BPEL) process to send data to Oracle BAM as a step in the process
4.      Oracle BAM sensor actions (which use Oracle BAM Adapter) can be included within a BPEL process to publish event-based data to the Oracle BAM data objects (BAM Sensor Action).
Note:
Before start this you need to complete two tasks:
1.      Complete my previous post Configuring BAM Adapter Properties .
2.      Get Completed   PO Processing  Application” or do PO Processing application  SOA sample which is from oracle (because this post is written with use case of PO Processing Application).

Using Oracle BAM Monitor Express With BPEL Processes

            The Monitor Express offering from Oracle BAM provides high level instrumentation of BPEL processes, automatically handling Oracle BAM data object deployment and population.
            Activity Monitors and Monitoring Objects are used to capture BPEL process metrics, which are sent to Oracle BAM Server, and then used for analysis and graphic display. All of the connection, design, and deployment configuration is accomplished in Oracle JDeveloper.
                                               
Using the BPEL Designer Monitor view in Oracle JDeveloper, you can create the following types of monitors on a BPEL process:
  • Activity Monitors capture running time data for BPEL process activities, scopes, and human tasks. Activity Monitors can help identify bottlenecks in the BPEL process.
  • Counter monitoring objects capture the date and time when a particular BPEL activity event is encountered within the BPEL process. Counters may be useful for reporting the number of times a particular activity is executed over a period of tim
  • Interval monitoring objects capture the amount of time for the process to go from one BPEL activity event to another. Interval monitoring objects can help identify bottlenecks in the BPEL process
  •  Business Indicator monitoring objects capture a snapshot of BPEL variables or expressions at a specified activity event in the BPEL process.
When the SOA composite application is deployed, the Oracle BAM data objects corresponding to the BPEL process monitors are created or updated automatically.

Access BPEL Designer Monitor View

1.       Start JDeveloper.

2.       Open Po Processing Application (which is running end to end flow).

3.       Open composite.xml of Po Processing application. Once it open  you able to see composite shown in below diagram.

4.       Double click on   ApproveLargeOrder BPEL Process.

5.       In BEPL Editor, right side tops you able to see Monitor option select Monitor toolbar.
6.       In Monitor view, the structure pane displays the Monitoring Objects folder. You can expand the folder to expose the Business Indicators, Intervals, and Counters folders.

Configure Activity Monitors

7.       In the Monitor view of a BPEL process, click Monitoring Configuration in the BPEL Designer tool bar.

8.      In the Monitoring Configuration dialog, select Enable Activity Monitoring, and choose the Mode to configure the level of monitoring.

Types of modes:
  • The All Activities option captures start and end time data for every activity in the BPEL process, including individual activities, scopes, and human tasks. An activity starts when the activation event for the activity is begun, and it ends when the completion event is finished. 
  •   The Scopes and Human Tasks Only option captures start and end time data for every scope and human task defined in the BPEL process.
  • The Human Tasks Only option captures start and end time data for every human task activity defined in the BPEL process.
  •  The BPEL Process Only option captures start and end time data for the BPEL process.
9.      You can disable Activity Monitors by deselecting the Enable Activity Monitoring checkbox.
   
10.      In this Example select Mode as Scopes and Human Tasks Only(Based on your requirement you can choose other modes)


11.        Click OK.

12.      Save the application by using Save Button from JDeveloper Toolbar. 
13. deploy the application and test. you can see my next sequence of posts to In-depth implementation,deploy and test the application.