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.
SUPERLIKE nice solution for a newbie
Thanks Abhishek.
good..example
Hi i am getting this error upon deploying your application.any suggestions deeply appreciated
[2011-06-27T12:05:54.453+05:30] [soa_server1] [ERROR] [OWS-04115] [oracle.webservices.service] [tid: [ACTIVE].ExecuteThread: ’0′ for queue: ‘weblogic.kernel.Default (self-tuning)’] [userId: ] [ecid: a2102929d0014fce:-3629f26d:130c01b68a6:-8000-0000000000000c2a,0:2] [APP: soa-infra] An error occurred for port: FabricProvider: java.lang.RuntimeException: javax.xml.soap.SOAPException: Error parsing envelope: most likely due to an invalid SOAP message.: Non-default namespace can not map to empty URI (as per Namespace 1.0 # 2) in XML 1.0 documents[[
Which version of SOA suite are you using. Also, let me know the steps you followed please.
I am using oracle soa suite latest version pack 11.1.1.5
I followed same steps u have mentioned in this blog.
1.First created data objects in bam and then created fields.
2.Then in studio mode selected new report and then chart values .
3.then i went to deployment section in console,there i changed the values of bam adapter connection factory–>eis/bam/rmi-> i provideed these values:
password:welcome1 (which i provided all time )
username:weblogic
instancename :adcserver1 (i took it as default)…i donot know whether to change or not
hostname:localhost
port:9001
then :
i created new generic project,one way bpel process,in inlut selected my schema.. and then new activity sensor in bpel .. under input section :i selected my schema and in output namespace section i gave : http://xmlns.oracle.com/bam.
then in activity sensor :
i selected my data object by connecting with bam server,which i created before…the fields are on left side as soon as i select data object..
bam connection factory jndi is:eis/bam/rmi
next i selected mapping file(.xsl)…i clicked and mapped my input with to the bam fields …then i saved it..deployed it…
in test options i am providing values then it is throwing the above errors in log
(but while compiling in jdeveloper there ‘s no error)
I used 11.1.1.3, though that should not cause issues since you are recompiling in JDeveloper.
“i selected my schema and in output namespace section i gave : http://xmlns.oracle.com/bam”
I think you are referring to
http://www.orafmwschool.com/wp-content/uploads/2011/03/image14.png
If you had selected Employee variable “$inputVariable/payload/ns1:Employee”, output name space will be auutomatically populated. You should not change it to “http://xmlns.oracle.com/bam”.
Also, were you able to map XSL as described in
http://www.orafmwschool.com/wp-content/uploads/2011/03/image18.png?
Thanks a lot for your reply.
Ya I was following to that link you mentioned above.
When i am selecting “$inputVariable/payload/ns1:Employee ” output namespace is not populating automatically here.thats why i gave output namespace as “http://xmlns.oracle.com/bam” .But I could map xsl as described in pic..
Can you specify “http://orafmwschool.com/training/bam/xsd” as output namespace please? As you can see from employee.xsd under xsd folder, target namespace is “http://orafmwschool.com/training/bam/xsd”. Hence, during runtime, XSL processor is unable to find correct source document I think.
the application is still throwing the same error upon pasting the output namespace mentioned by you.By the way when I am clicking on your link http://orafmwschool.com/training/bam/xsd you provided the site response was “oops that wasn’t found.”.Please just check it out.
http://orafmwschool.com/training/bam/xsd happens to be the target namespace in employee.xsd. See http://www.orafmwschool.com/wp-content/downloads/lesson7/employee.xsd.
Please send your email ID.
hiii by using your link “http://www.orafmwschool.com/wp-content/downloads/lesson7/employee.xsd” finally i could run the application successfully.:)
the output namespace is genrating automatically upon selecting the employee schema under input.
thanx a lot
:)
my maild is :shiladg@gmail.com
Glad to hear that. Good luck with rest of the stuff.
Hi,u give the target in admin server,it will automatically connect ,otherwise do one thing,please restart the servers.
Hi, I am able to deploy the project, test the composite with inputs and see instances. But, BAM Dashboard does not show any results (No Values). Can you tell me what might be missing. Thanks in advance.
Prasad, did you map BPEL variable to BAM correctly? Also, please check the BPEL messages from console to make sure information is passed to BAM correctly.
Hi I have the same problem as Prasad and to be sure I’ve downloaded your project and it is compiled without any problem and I could enter the name and dept in test but nothing happens in Dashboard so the only thing that I’m not sure is my OracleBamAdapter , the problem is that the server is not localhost so should I write the IP adress there ? and the instance what it should be ? as default or something else ?
Aryan, are you using SOAP or RMI connection factory? Please check SOA Server log file whether any adapter related errors are logged in.
I use RMI because when I open the SensorAction in JDeveloper ,BAM connection factory JNDI : eis/bam/rmi . so do you have any idea ? or maybe my settings in server have problem ?
Aryan, can you reproduce the issue and mail me soa server log file please at admin@orafmwschool.com?
Hi,
I am like Prasad able te deploy the composite.
But i cannot see any data in BAM, employee stays empty. I downloaded the sample project to make sure i do exactly the same.
Thanks in advance.
Can you give me the versions of JDeveloper and SOA Suite please? It works on 11.1.1.3 JDeveloper & SOA Suite. Also, can you see instance completing successfully in Enterprise Manager?
I am using Jdeveloper 11.1.1.5, but everything is recompiled in the composite. SOA suite is still on 11.1.1.4 in our project.
In EM i can see the instance completing succesfully, only in the serverlogging this error showed up:
Exception not handled by the Collaxa Cube system.
an unhandled exception has been thrown in the Collaxa Cube systemr; exception reported is: “BINDING.JCA-12563
Exception occured when binding was invoked.
Exception occured during invocation of JCA binding: “JCA Binding execute of Reference operation ‘writetoBAM’ failed due to: javax.security.auth.login.LoginException: [Security:090304]Authentication Failed: User javax.security.auth.login.LoginException: [Security:090301]Password Not Supplied”.
The invoked JCA adapter raised a resource exception.
Please examine the above error message carefully to determine a resolution.
But password is provided like your example (another password of cource)…
Error message clearly points at missing password. Either it is not saved in WL Server or incorrectly entered. To isolate issue
- Please check if you are able to connect to BAM server through JDeveloper.
- Make sure you have restarted BAM adapter in Weblogic server after entering user credentials.
- Hit ENTER key after specifying password. Otherwise, even with “Apply” button, your changes are not saved.
The password was expired since yesterday. By resetting the password the problem is solved. I think before yesterday the connection trough Jdeveloper worked but through Weblogic/BAM did not. And the error message was misleading.
Hi
I have a requirement,One interface say Hello world.How can I get the number request’s (count) for this interface and also in that count how to know how many are completed and how many are faulted.
When I follow some blogs,they were say it’s possible with BAM.
But I have no idea about BAM.If is there any alternative please give directions and instruction how to achieve this task.
Thanks in advance.
Regards
Mani
Mani, you can filter sensor actions based on specific events such as completion and faulted. Please see http://www.orafmwschool.com/wp-content/uploads/2011/03/image_thumb15.png from http://www.orafmwschool.com/bam-tutorial/. Essentially you can specify it through “Evaluation Time” field in Activity Sensor dialog.
Hi Amjad ;
I’m new to Oracle BAM. I don’t create data object.
I opened BAM Architect. Then, i click “Create Data Object” but i didn’t see anything like as input name field. Otherwise, i don’t see “Data objects” when create a new report page. I think, i forgot something configurations.
Can you help me, please?
You need to click on “Add a field” link at the bottom of “Create Data Object” page. See screenshot sent to your email ID.
nice example..thnks
Hi,
Good one………
It Helps a lot………
Hi Amjad,
As you mentioned the above example about BAM, i did everything step by step and i deployed the SOA Project and i tested it in Em console. It is showing the below mentioned error while clicking on Test button.
HTTP Basic Auth Option for WSDL Access
Either the WSDL URL is invalid or the WSDL file is not valid or incorrect. – WSDLException: faultCode=OTHER_ERROR: Failed to read WSDL from http://PC169212.cts.com:8001/soa-infra/services/default/BAMExample/bamexampleprocess_client_ep?WSDL: HTTP connection error code is 503
Can you suggest me for this type of error what i need to do.
Hi Amjad,
The above i posted the issue due to because of server error, when i restart the server the issue got resolved.
Regards,
Raj.