An Introduction to Oracle Business Activity Monitoring (BAM) – Part 1: Message Production

The majority of my Oracle SOA Suite customers are not taking advantage of the Business Activity Monitoring (BAM) capabilities of the platform. This is a real shame, because gaining the type of real time insight into your business that BAM can provide should be one of the primary reasons for adopting a SOA architecture in the first place.

For the uninitiated, Business Activity Monitoring allows you to visually see how your business is performing in the moment and then react if necessary. What you visualize is up to you – orders processed, carts abandoned,  reservations booked, reservations cancelled, etc. The beauty of using a SOA platform is that you already have all of this data flowing through a central system, so it just needs to be captured as it’s streaming by. Therefore, the first step after deciding that you want BAM is to decide what you want BAM do show.

For this exercise, I’m going to use a credit card processing service, so we can monitor things like authorizations, declines, purchase amounts, etc. Once I know what I want to monitor, I need to produce the data in a format that’s consumable by BAM. Oracle BAM can consume data from several source types. For this tutorial we are going to use an Enterprise Message Source, which is one of the more flexible and popular types.

I’ve decided to break the tutorial into three Parts. Part 1 (this part) will focus on the production of data. Part 2 will focus on the consumption of that data into BAM. Part 3 will conclude with using the data to design a dashboard.


As a starting point, I’m going to use the ValidatePayment composite from the Oracle SOA Suite 12.1.3 end-to-end tutorial. This composite contains a simple web service which validates a credit purchase.  I’ve documented the steps of installing the ValidatePayment composite into the Pre-built Virtual Machine for SOA Suite. So if you want to follow along, as a starting point, please complete Deploying ValidatePayment to the OTN SOA VM.

Step 1: Create JMS Artifacts

  1. Open the WebLogic Admin Console.

Create a Persistent Store

By creating a persistent store we will be able to view the message text in the console (that last step of this exercise).

  1. Select Peristent Stores.
  2. Create a New FileStore named PaymentJMSFileStore:


  3. Target the file store to soa_server1. The JMS resources must be targeted to the SOA server so that the composite (deployed to the SOA server) can locate them:


  4. Click Finish.

Create a JMS Server

  1. Select JMS Servers.
  2. Create a new JMS Server named PaymentJMSServer:


  3. Select the PaymentJMSFileStore Persistent Store:


  4. Target the file store to soa_server1 and click Finish.

Create a JMS Module

  1. Select JMS Modules.
  2. Create a new JMS Module named PaymentJMSModule:


  3. Target the JMS Module to the AdminServer, bam_server1, and soa_server1. The JMS resources should then be locatable from any of these servers. At a minimum, the deployed composite will look at soa_server1 and BAM Composer will look at bam_server1:


  4. Click Next and select Would you like to add resources to this JMS system module? and click Finish:


    This will take you directly to the page where you can added resources.

Create JMS Resources


We will use a subdeployment to group all of our JMS resources together. It’s also via the subdeployment that we target our resources to the appropriate managed servers.

  1. Click the Subdeployments tab create a new subdeployment named PaymentSubdeployment:


  2. Target the subdeployment to the PaymentJMServer we just created:



  1. Switch to the Configuration tab and create a new Queue named PaymentQueue with the JNDI Name of jms/PaymentQueue:


  2. Select the PaymentSupdeployment we just created and click Finish:


Connection Factory

  1. Create a new Connection Factory named PaymentConnectionFactory with the JNDI Name of jms/PaymentConnectionFactory and click Finish.


Step 2: Configure the JMS Adapter

The JMS Adapter from the ValidatePayment SOA composite will connect via this connection.

  1. Select Deployments.
  2. Select the JmsAdapter and select the Configuration tab and Outbound Connection Pools sub-tab. Create a new Outbound Connection Pool configuration and select oracle.tip.adapter.jms.IJmsConnectionFactory as the Outbound Connection Group:


  3. Set the JNDI Name to eis/jms/PaymentQueue and click Finish:


  4. Change the plan file name to JMSPlan.xml and save the Deployment Plan:


  5. Edit the eis/jms/PaymentQueue configuration we just created and set the ConnectionFactoryLocation to jms/PaymentConnectionFactory. Now we have mapped the JMS Adapter to the JMS Connection Factory.


  6. Return to deployments, select the JmsAdpter and select Update and then Finish:


Step 3: Configure the Composite

Create a Schema

In BAM, we are going to define a data object that represents the data we want to monitor. In our composite, we need to define a schema that maps to the BAM data object we will eventually create.

  1. In JDeveloper, create a new PaymentForBAM.xsd in the SOA/Schemas folder with the following contents:
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsd:schema xmlns:xsd="" xmlns=""
               targetNamespace="" elementFormDefault="qualified">
     <xsd:complexType name="PaymentAuthorizationType">
         <xsd:element name="CARD_NAME" type="xsd:string"/>
         <xsd:element name="FIRST_NAME" type="xsd:string"/>
         <xsd:element name="LAST_NAME" type="xsd:string"/>
         <xsd:element name="CITY" type="xsd:string"/>
         <xsd:element name="STATE" type="xsd:string"/>
         <xsd:element name="AUTHORIZATION_AMOUNT" type="xsd:float"/>
         <xsd:element name="CREDIT_LIMIT" type="xsd:float"/>
         <xsd:element name="PAYMENT_STATUS" type="xsd:string"/>
     <xsd:element name="PaymentAutorization" type="PaymentAuthorizationType"/>

Configure the JMS Adapter

We will use the JMS Adapter to publish messages on the queue.

  1. Open the ValidatePayment composite.
  2. Drag and drop a JMS Adapter into the External References lane. Name the reference Produce_Message:


  3. Select Oracle Weblogic JMS as the Oracle Enterprise Messaging Service (OEMS):


  4. Select SOA_Domain as the AppServer Connection:


  5. For the Interface, select Define from operation and schema (specified later). This will be the PaymentForBAM.xsd we created above:


  6. Select Produce Message as the Operation Type and name the operation Produce_Message:


  7. Browse for Destination Name and select the PaymentJMSModule PaymentQueue (queue):


  8. For the JNDI Name, use the JNDI browser to ensure the name has been set up correctly in the directory:


    Your Produce Operation Parameters should appear as follows:


  9. On the Messages page, browse and select the PaymentAuthorizationType from the PaymentForBAM.xsd that we created earlier:


    Your Messages page should appear as follows:


  10. Click Next and Finish to complete the wizard.
  11. Wire the JMS Adapter to the Composite. The composite should now look as follows:


Invoke the JMS Adapter

  1. Open the validatePaymentProcess BPEL component.
  2. Drag and drop and Invoke before the replyOutput and name it Invoke_Produce_Message.


  3. Wire the Invoke to the Produce Message Partner Link. This will open the Edit Invoke dialog. Click the plus sign to create a new input variable. Select the default name (Invoke_Produce_Message_Produce_Message_InputVariable) and click OK.


  4. Click OK to close the Edit Invoke dialog.
  5. Drag and drop and Assign before the Invoke_Produce_Message and name it setMessageValues.
  6. Edit the setMessageValues assign by double-clicking it. Map the appropriate values to the Invoke_Produce_Message_Produce_Message_InputVariable.From the inputVariable you should map the following:
     CardName  -  CARD_NAME
     FirstName -  FIRST_NAME
     LastName  -  LAST_NAME
     City      -  CITY
     State     -  STATE

    From the outputVariable:

     Status    - PAYMENT_STATUS

    From the getPaymentInformation_getPaymentInformationSelect_OutputVariable:

     dailyLimit - CREDIT_LIMIT

    The result should look as follows:


Step 4: Deploy and Test

  1. Save All and Deploy ValidatePayment to the SOA_Domain.
  2. Switch to Enterprise Manager Fusion Middleware Control and navigate to the Test Web Service page of the ValidatePayment composite.
  3. Browse and select the PaymentInfoSample_Authorized_soap.xml and click Test Web Service.
  4. Switch to the WebLogic Console and navigate to the PaymentQueue (soa_domain > Services > Messaging > JMS Modules > PaymentJMSModule). Switch to the Monitoring tab where you should see the message in the queue:


  5. Select the PaymentJMSModule!PaymentQueue and click Show Messages to see the Summary of JMS Messages:


  6. Click the message ID to view the message details:


Excellent, we now have data being published to a JMS queue. In Part 2, we will consume this data for business analysis.





2 thoughts on “An Introduction to Oracle Business Activity Monitoring (BAM) – Part 1: Message Production

  1. Pingback: An Introduction to Oracle Business Activity Monitoring (BAM) – Part 2: Message Consumption | W Brian Leonard

  2. Pingback: An Introduction to Oracle Business Activity Monitoring (BAM) – Part 3: Dashboard Design | W Brian Leonard

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s