Integrating BPEL and BAM in Oracle 11g SOA Suite

Following hot on the heels of a previous article on BAM – Business Activity Monitoring in Oracle 11g SOA Suite – this article will discuss how to integrate BPEL and BAM, more specifically: how to make a BPEL process send ‘live’ process instance execution data to BAM and how to have BAM display these details in a dynamic web-based report. Having created that basic integration, the sky is the limit when it comes to building rich, powerful consoles for monitoring Business Process execution.

We will start humbly: with almost the easiest, simplest BPEL process there is and a similarly trivial BAM Data Object and Report. But the key concepts are here.

I will assume as a starting point that all of the BAM Server, JDeveloper 11g and the SOA Suite run time (part of the JDeveloper 11g install) have been installed and are up and running.

The steps we will go through in this article are:

  1. create a new Data Object in BAM (also the interface between the BPEL process and the BAM Active Data Cache)
  2. create an HelloWorld BPEL process
  3. add a variable sensor and a BAM Sensor action to the BPEL process
  4. deploy and run the BPEL process
  5. verify the creation of instances of the BAM Data Object
  6. create a BAM report based on the Data Object
  7. view the report and watch it update in real time as more BPEL process instances are started

 

The first step is creation of the BAM Data Object. Login to the BAM Web Application – http://host:8888/OracleBAM/default.htm – and go to the Architect.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4001

 

Click on Architect:

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4002

Click on Create Data Object and fill in the details for the HelloWorldDO Data Object:

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4004

The DataObject has three fields that contain respectively the inputParameter sent into the BPEL process, the timestamp of the start of the process instance and the instanceId which identifies both the BPEL Process Instance and this data object.

Click on Create Data Object.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4005

and the object is presented:

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4006

What we have now is an interface that external data (event) providers can hook into. We will now continue to create a BPEL process that feeds into this Data Object. Then we will return to BAM to create a Report based on this Data Object that will display the data fed into it.

Step 2 – create an HelloWorld BPEL process

Before we continue and if you have not already done so, create a BAM Server Connection. Do this via File, New and select Connections, BAM

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4013

Create the Connection in the Application Resources.

The username is fmwadmin and the default password is welcome1.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4014

Test the connection and upon success, press Finish.

You have to make sure that you have only one BAM Server connection.

In JDeveloper 11g, create a new Application with SOA technology template. Create a new project, call it for example HelloWorldBPELandBAM. Open the SOA Composite. Add a BPEL Component to the composite.

Note that  this is a simple synchronous process.

Press OK.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4008

Double Click the BPEL component to start adding details to the process definition.

Add an Assign step.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4009

Edit the Assign Step. Set the output parameter to the string concatenation of Hello and the input parameter.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4010

Step 3 – add a variable sensor and a BAM Sensor action to the BPEL process

In the structure window for the BPEL process, locate the node Sensors\variable and click on the create icon.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4011

Edit the properties to the new sensor, in particular the name and the target – the input element in the inputVariable.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4025

Press OK.

In the Structure Window locate the node Sensor Actions and click on the create icon. Select BAM Sensor Action from the dropdown list.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4016

In the window that pops up, type the name for this BAM Sensor Action.

Browse for the BAM Data Object this sensor action will feed into – the HelloWorldDO object.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4017

Select the Insert operation. Select _instanceId as the Selected Key. You may want to change the name of the XSL Mapping file that will specify the mapping from data in the BPEL process (instance) to the DataObject, for example to bam\InputToHelloWorldDO.xsl.

Press the icon to create the mapping file.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4018

In the Mapper connect the appropriate elements in the Header and the Payload to the BAM DataObject.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4019

 

Close the Mapper, save all and we are done creating the BPEL process.

Step 4 – deploy and run the BPEL process

Select Deploy …. to Bundled OC4J Server from the RMB menu on the project. Make sure that the Bundles OC4J server is running when you do this.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4021

Open the SOA Console, locate the HelloWorldWithBAMSensors component and start an instance.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4022

Enter a value for the input parameter and press the Invoke button.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4023

After some time the synchronous BPEL process will return its response:

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4024

And if all is well, it will have sent out signals to the BAM Server as well.

Step 5 – verify the creation of instances of the BAM Data Object

Return to the BAM Server.  Click on the Contents link on the Data Object overview page. The page will refresh with the current contents for this Data Object. It should now show a single DataObject instance, created from the BP
EL process instance that just return ” Hello Tommy”  to us.

c=”https://technology.amis.nl/wp-content/uploads/images/bam11gtp4027.jpg” />

If you feel like it, you can run a few more BPEL Process Instances and find them producing additional DataObject instances.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4028

 

Step 6 – create a BAM report based on the Data Object

Close the Architect module in BAM. Now start the Active Studio. Click on Create New Report.

Select the simplest Report Layout, shown in the upper left hand corner.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4029

Set the Report’s title to HelloWorld Monitor.

Click on the Streaming List icon to select the View Type. Note: we can later on change the View Type for our Report. A Streaming List presents a tabular display of data that is actively refreshed when new data arrives.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4030

Select the HelloWorldDO as the base Data Object.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4031

Accept all three Data Fields – you can rearrange them if you like.

Press OK to apply the changes. Note: you can very easily go in to edit the Report properties such as display and layout styles, prompts, filters etcetera.

For now we are satisfied. Save the Report and click on View.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4032

 

Step 7 – view the report and watch it update in real time as more BPEL process instances are started

If we now start some additional BPEL process instances of the HelloWorld process, this report will automatically get updated. We can sit back and relax and watch as new records are added.

Integrating BPEL and BAM in Oracle 11g SOA Suite bam11gtp4033

 

7 Comments

  1. saileshan December 12, 2011
  2. Lucas Jellema December 11, 2011
  3. saileshan December 4, 2011
  4. mani November 21, 2011
  5. Dwight Looye October 7, 2011
  6. Dwight Looye October 7, 2011
  7. Ieka January 14, 2009