Populating BAM using JMS

Recently I did a POC with BAM 12c at the customer. In a series of post’s I will describe my findings/experiences.
In the first post of this series I described the initial situation (Impact of ACM Implementation on BAM). This post ended up with the following challenge.

We have a ACM Case consisting of about thirty Case Activities. The Case and the individual Case Activities are housed in a private composite (1 + ~30 composites).

Challenge: How can we group/filter in BAM by ‘specific’ metrics that are present in each Composite. For example ‘Department ‘.

In the second post Filtering/grouping in BAM by ‘specific’ metrics (explored solutions) I have 10 recognized/examined solutions appointed for this challenge. In this post one of these solutions (number 10) is further developed.

I will describe an implementation of how to populate BAM via a JMS queue. In a nutshell: we have the following situation:
An ACM Case Management composite (CASE A) with the Case Activities implemented in external BPM processes (Proces 1,2 and 3). The humantask metrics are available in BAM via the ‘default’ channel. For other metrics the composites have to send events. These events are catched by the Event Handling Service. This service puts them on the JMS Queue BAM uses as input source. Graphically represented:

3image1

Initially I thought that this would be a very big post because the implementation of this solution consist of a very large number of steps. However, there are several existing post available which these steps already described. In my opinion it does not make sense to describe them again. So in this post I will refer to the other posts and then simply mention the used configuration.

As a starting point for the implementation I have used the oracle tutorial: Populating BAM in SOA using JMS (A sample project and additional documentation can be found on the Oracle website). Enterprise Message Source (EMS) is used for the  connectivity of JMS with the BAM Server.

Enterprise Message Source

From the Oracle documentation:
Enterprise Message Sources (EMS) are used by applications to provide direct Java Message Service (JMS) connectivity to the Oracle BAM Server. JMS is the standard messaging API for passing data between application components and allowing business integration in heterogeneous and legacy environments. The EMS does not configure Extract Transform and Load (ETL) scenarios, but rather maps from a message directly to a data object on the Oracle BAM Server; however, you can still use XML Stylesheet Language (XSL) to perform a transformation in between. Each EMS connects to a specific JMS topic or queue, and the information is delivered into a data object in the Oracle BAM Active Data Cache. The Oracle BAM Architect web application is used to configure EMS definitions.

As stated, the information is directly delivered to a data object. For this I created a data object that fulfils the requirements. The data object:
3image2

When implementing this tutorial I had the following issue.
I’m running BAM on a different Managed Server as SOA/BPM. That means that I need to configure JMS Store And Forward (SAF) to send messages from the SOA/BPM Server to the BAM Server. I have describe below how I have done this.

WebLogic Store-and-Forward (SAF) Service for use with WebLogic JMS

What is the Store-and-Forward (SAF) Service?
Again, from the Oracle documentation (https://docs.oracle.com/middleware/1213/wls/SAFMG.pdf):

The SAF service enables WebLogic Server to deliver messages reliably between applications that are distributed across WebLogic Server instances. For example, with the SAF service, an application that runs on or connects to a local WebLogic Server instance can reliably send messages to an endpoint that resides on a remote server. If the destination is not available at the moment the messages are sent, either because of network problems or system failures, then the messages are saved on a local server instance, and are forwarded to the remote endpoint once it becomes available.
There are two sides involved in the process of storing and forwarding messages: a local sending side and a remote receiving endpoint. SAF agents are responsible for store-and-forwarding messages between these local sending and remote receiving endpoints. A SAF agent can be configured to have only sending capabilities, receiving capabilities, or both.
JMS SAF only requires a sending agent on the sending side for JMS messages. The JMS server associated with a remote exported JMS destination on the receiving side manages duplicate elimination.
Sending agent — If message persistence is required, a sending agent stores messages to a persistent storage, forwards messages to the receiving side, and re-transmits messages when acknowledgements do not come back in time.

Why use the Store-and-Forward (SAF) Service?
In the context of this post I used the SAF Service to send message from the SOA Managed Server to the BAM Managed Server. The architecture is shown in the picture below:
3image3

The configuration steps I have followed are described in a blog on fmwblogadmin .

My configuration:

Sending Side (BPM Server):

  1. JMS Server and Store:
    1. KEIBPMJMSServer
    2. KEIBPMFileStore
      1. Directory: specify file store location
  2. JMS Module with a connection factory inside
    1. KEIBPMModule
      1. Connection Factory
        1. KEIBPMConnectionFactory
        2. JNDI: jms/KEIBPMConnectionFactory
  3. SAF Agent connected to the created file store
    1. KEISAFAgent
      1. KEIBPMFileStore
  4. Sub-deployment
    1. KEISAFSubDeploy
    1. SAF Imported Destination with a Remote SAF Context, SAF Error Handling and SAF Imported Destination Queue.
      1. SAF Imported Destination
        1. Remote SAF Context
          1. RemoteSAFContextURL
            1. URL: T3://localhost:7003
            2. Username / password
        2. SAF Error Handling
          1. SAFErrorHandling
        3. SAFImportedDestination
          1. Remote Context: RemoteSAFContextURL
          2. Error Handling: SAFErrorHandling
          3. Targeted to Sub-deployment KEISAFSubDeploy
        4. SAF Imported Destination Queue
          1. SAFQueue
            1. Remote JNDI: jms/KEIBAMQueue
            2. Local JNDI: jms/KEISAFQueue
            3. Error Handling: SAFErrorHandling

Receiving Side:

  1. JMS Server and Store:
    1. KEIBAMJMSServer
    2. KEIBAMFileStore
      1. Directory: specify file store location
  2. JMS Module with two connection factories, two JMS queues and a sub-deployment inside
    1. KEIBAMModule
      1. Connection Factory
        1. KEIBAMConnectionFactory
        2. JNDI: jms/KEIBAMConnectionFactory
      2. Error Connection Factory
        1. KEIBAMErrorConnectionFactory
        2. JNDI: jms/KEIBAMErrorConnectionFactory
      3. Sub-deployment
        1. KEIBAMSubDeploy
      4. JMS Queue
        1. KEIBAMQueue
        2. JNDI: jms/KEIBAMQueue
      5. Error JMS Queue
        1. KEIBAMErrorQueue
        2. JNDI: jms/KEIBAMErrorQueue

The implementation is shown in the picture below:

3image4

Compared to the steps in the fmwblogadmin blog there is one difference that is important here. I have also defined an error queue on the BAM Server side. After that the message is received on the BAM Server. The message is available for processing. It there is going something wrong for whatever reason the message is forwarded to the error queue. For example the message has a format that does not meet the BAM expectations. The usage of this queue is also describe in the tutorial I started this post with.

So at the end, there is nothing new underneath the sun. For my use case I had to combine an Oracle tutorial and a blog post on ‘fmwblogadmin’ to get my implementation to work.

Conclusion: this part of the solution is pretty easy to implement. Whether the solution is actually applicable in practice depends on the implementation of the ‘Event Handling Service’. This service must be triggered at the right moments. How do we implement this? And is all necessary information provided to this service? Or must the data be retrieved from the SOAINFRA database in this service? And how does this affect the performance? Further research is needed to find answers to these questions.

Advertisements

2 thoughts on “Populating BAM using JMS

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s