What is BAM?
Business Activity Monitoring is a tool that is useful in monitoring business services and processes. It actively collects data, applies rules and reports information to users. When something goes wrong in business processes, BAM can be configured to take corrective measures such as emailing administrators/support team.
How does BAM interface with other SOA applications?
BAM uses Data Objects to capture and store information from other sources. It uses Real Time Data Streaming to stream data through Oracle BAM Adapter, JMS connector, ODI or web service API.
We are going to explore the features of BAM through a simple use-case as shown below:
Description: Employee information is sent to BAM Example Process (BPEL). BPEL sensors sends this information through BAM Adapter to populate Employee Data Object in BAM. Employee Dashboard report will capture this information and show in the form of a 3D Bar chart.
Steps to implement use-case:
- Create Employee Data Object
- Create BAM Report
- Configure BAM Adapter
- Create BPEL Sensor Activity and Sensor Action
1. Create Employee Data Object
- Open BAM console using http://<yourhost>:9001/OracleBAM
- Open BAM Architect
- Click on "Create Data Object" and enter "Employee" in the name field.
- Click on "Add Field" and add following fields: id (Auto-incrementing Integer), name (String), department (String).
- Click on "Create Data Object" to finish creation. You can optionally create a sub-folder to hold Employee object.
- Make sure Employee object is visible under Data Objects section.
2. Create BAM Report
- Open Active Studio
- Click on "Create a New Report".
- Click on first option: Single tiled Report.
- Enter "Employee Dashboard" for Report title and select "3D Bar Chart" as report type.
- Select "Employee" object from Data Objects section at the bottom and click on Next button.
- Select “Department” in Group By section, “id” in Chart Values and “Count” in Summary Function(s). Click on Next and then Finish button.
- Save this report and it will be visible through "Recent Reports" in Home tab. This report now shows Employee count grouped by Department.
3. Configure BAM Adapter
- Open Weblogic Server Administration Console.
- From left side Domain Structure section, select Deployments.
- Search and select "OracleBamAdapter".
- Click on "Configuration" and "Outbound Connection Pools" from OracleBamAdapter settings page.
- We can see predefined connection pools for RMI and SOAP connections. Expand both connection factory links. We need to configure these connection pools to use BAM server.
Important: Repeat following steps for both "eis/bam/rmi" and "eis/bam/soap".
- Open “eis/bam/rmi” link and enter Outbound connection properties as follows. Replace connection parameters as per your installation. Hit “Enter” key after entering each property value. Click on Save once you’ve finished.
- Open “eis/bam/soap” and enter connection parameters as follows. Hit “Enter” key after entering each property value. Click on Save once you’ve finished.
Note: The UserName field should contain an Oracle BAM user who is a member of application-level role Administrator or Report Architect. “weblogic” user by default is an Administrator.
- Clik on OracleBamAdapter from Deployments page. Go to Control tab. Select OracleBamAdapter, click on Stop and then Start buttons. Now, Oracle BAM Adapter is ready for use.
4. Create BPEL Sensor Activity and Sensor Action
- Create an empty Generic Project and name is BAMExample.
- Import following employee.xsd file into BAMExample project.
- Create one-way BPEL process and name it BAMExampleProcess. Select Employee element from Project Schema Files for Input message for the service.
- Double click on BAMExampleProcess in composite.xml to open the BPEL process.
- Click on Monitor button at the top right corner of the process window to change to Monitor view.
- Right click on receiveInput activity and create sensor.
- Change Evaluation Time to Completion. This will activate sensor after the completion of receiveInput activity. Select Employee element for inputVariable as shown below.
- From BAMExampleProcess Structure window, right click on Sensor Actions and Creatte –> BAM Sensor Action …
- Select ActivitySensor_1 for Sensor property. Choose Employee Data Object from BAM Data Object Chooser.
- Select “Insert” as Operation type. One other interesting operation is Upsert that stands for Update/Insert. This operation creates an object if one does not exist or updates an existing one.
- Ensure BAM Connection Factory JNDI value is “eis/bam/rmi”. We can specify “eis/bam/soap” in case BAM and BPEL servers are separated by a Firewall.
- Create a new mapping between BAM data object and BPEL input variable as shown below.
- Establish XPATH mapping.
- Click on OK to close Sensor Action creation Dialog.
- Right click on BAMExample bpel process and deploy to SOA Server.
Test BAMExample process
- Go to BAMExample in Enterprise Manager and Test the process.
- Enter Oracle1 and ORACLE for name and department respectively. Click on Test Web Service.
- Open BAM Active Viewer. Click on “Select Report” and choose “Employee Dashboard” report we saved earlier. We can see the updated graph. Experiment with different values.
Complete JDeveloper project for above use-case can be downloaded from here.