Skip to main content

Architecting on demand solutions, Part 12: Use DB2 Alphablox to generate reports for your business processes

Use historical data to provide insight

Dorian Birsan (birsan@ca.ibm.com), Advisory Software Developer, IBM
author photo
Dorian Birsan works on various projects on application development tools at the IBM Toronto Labs. As an Eclipse Platform committer since its inception, he has played an active role in leading the help system and the update manager development. Dorian's current technical interests are SOA technologies and finding simpler solutions to complex problems. Contact Dorian at birsan@ca.ibm.com.
Christina Lau (clau@ca.ibm.com), Senior Technical Staff Member, IBM Software Group
Christina Lau
Christina Lau is a Senior Technical Staff Member at IBM. Christina is an architect on the On Demand Development team focusing on next-generation technologies for the IBM On Demand Operating Environment. You can reach Christina at clau@ca.ibm.com.

Summary:  In this twelfth article in the series, you learn how to use IBM DB2® Alphablox to generate reports showing historical data about your Business Process Execution Language (BPEL)-based business processes running on IBM WebSphere® Business Integration Server Foundation V5.1.1. DB2 Alphablox is a development platform that can help you quickly build and deploy Web-based reports. By integrating DB2 Alphablox with the audit log data written by the process choreographer engine, you can visualize the statistics and execution metrics of your business processes. Reviewing historic data on your business processes can give you valuable insight about how to optimize your business functions.

Date:  30 Aug 2005
Level:  Intermediate
Activity:  1159 views

Introduction

Business processes in your IT infrastructure contain valuable information about how your company operates. Tapping into that information can help you better optimize your business functions, making your company more efficient. In this article, find out how to generate reports that provide historical data about Business Process Execution Language (BPEL)-based business processes running on WebSphere Business Integration Server Foundation V5.1.1.


Use the WebSphere Process Choreographer audit log

When a process instance is started and audit trailing is enabled, WebSphere Process Choreographer writes information about each significant event into an AUDIT_LOG_T table in the business process container database. The data captured in this table contains event information such as the process instance and template, activity state, event time stamp, and so on.

The data in the process and activity instance tables may be purged by the process choreographer engine if the process is marked for delete after completion. However, the data in the AUDIT_LOG_T table is never purged directly by the engine, so it can be used for historical reporting. Typically, in a production environment, the audit table can also be moved to a nonproduction server and reports can be generated from that server.


Understand DB2 Alphablox

Developing Web-based reports of relational data is often done using temporary solutions with standard HTML tables or custom-made presentations; sometimes off-the-shelf reporting libraries are used. As reporting needs grow, so does the complexity of programming them. DB2 Alphablox is a development platform that can help you quickly build and deploy Web-based reports, simplifying both the access to the data and its rendering, using standard Java™ 2 Platform, Enterprise Edition (J2EE) mechanisms. Reports are rendered by either Java applets or Dynamic HTML (DHTML). We'll use DHTML in this article.

The programming model that Alphablox exposes to the application developer follows the usual J2EE programming model. Reports are implemented using JavaServer Pages (JSP) components containing HTML, Cascading Style Sheets (CSS), JavaScript, Java code, and Blox.

Blox (as in " building blocks") are the main components provided by Alphablox for accessing and visualizing data, and for performing various UI or non-UI related tasks. Blox are packaged in custom tag libraries and are usually embedded in a JSP by inserting the appropriate Blox tag. Many Blox attributes let you customize the reports. If this is not enough, or when more dynamic reports are needed, developers can programmatically access the Blox on a page, because all the Blox are exposed as JavaBeans components. This provides tremendous flexibility and power to customize the reports using a rich set of Java application programming interfaces (APIs).

When Blox are added to a JSP page, you need to specify the:

  • Data source and query to extract the data
  • Presentation of the data
  • Method of viewing, manipulating, analyzing, or sharing the data for the user

You can access data using a DataBlox with the appropriate attributes set to identify the data source and the query. The DataBlox is then associated with a visual Blox; GridBlox and ChartBlox are the most commonly used Blox for reports. PresentBlox is often used, too, because it contains both a grid and chart Blox connected to the same data Blox.


Use Alphablox with WebSphere Portal server

In the most recent release, 8.2.1 fixpack 1, Alphablox introduced better support for seamless integration with WebSphere Portal server. Installing DB2 Alphablox 8.2.1 on top of WebSphere Portal server is relatively straightforward. On a standard portal server installation that has server1 and WebSphere_Portal as servers, make sure the server picked by the Alphablox installer is WebSphere_Portal, as shown in Figure 1.


Figure 1. Installing DB2 Alphablox on WebSphere Portal Server
alphablox install

As part of its installation process, Alphablox will install its administration interface and server Web applications, AlphabloxAdmin and AlphabloxServer. Using the administration interface you can configure various Alphablox components and set up your own applications. A typical installation topology is shown in Figure 2.


Figure 2. Alphablox general topology
alphablox architecture

What is an Alphablox cube?

Querying and displaying relational data is much easier when the data is modeled as a multidimensional cube. A cube is a data model often used in online analytical processing (OLAP) to represent business data that is typically analyzed over multiple dimensions. A dimension is a conceptual axis over which a business is analyzed. For example, you could analyze the execution trends in BPEL-based business processes using time, processes, and process states. In this case, time, processes, and process states are the dimensions. Each of the dimensions has one or more levels that together define the overall hierarchy of the dimension. For example, the time dimension could have levels such as year, month, and week ending.

Measures or facts are numeric values, usually business metrics (such as average execution time or number of process instances), at a given set of dimension intersections. For example, to view the number of processes in a given state (failed, running, and completed) during a certain time period, examine the cube at the point where those dimensions intersect to find the measures.

DB2 Alphablox Cube Server allows administrators to create a multidimensional representation of data that resides in a relational database and avoids the need to install a full-featured OLAP server. This capability is particularly useful when cubes are needed in a lower-cost solution that doesn't need the support of a full-featured OLAP.

When developing DB2 Alphablox cubes, one of the requirements is for the underlying database to use a dimensional schema, such as data for the measures (facts) and dimensions, that is physically separate. Typically, this is in the form of a star schema, a snowflake schema, or some hybrid of the two. If the database does not conform to a dimensional schema, you can create views in the database to create a "virtual" dimensional schema for use with a DB2 Alphablox cube. We use this approach in the BPEL reports.


Create an Alphablox cube for WebSphere Process Choreographer audit log table

The reports in this article can be used for any BPEL processes deployed on WebSphere Business Integration Server Foundation (Server Foundation) using the BPEDB database. To prepare the data for reporting:

  1. Create a multidimensional data source of the audit table using a star schema.
  2. Create views on the audit table for the facts and dimension tables.
  3. Develop two Alphablox cubes on top of these tables -- one for processes and one for activities.

Before creating the facts and dimension tables, several helper views and tables must be created in the BPEDB database:

  1. Using the process states constants defined by BPC, a process states table is created.
  2. Define the views for the running, failed, and completed processes. (If you are interested in other process states, you can define more views.)
  3. Define the processes view, which is the union of the running, failed, and completed processes.
  4. To support various time-related queries, create a view that lists the running time of all the completed processes.
  5. To support reports for particular time intervals, a dimension table is created with a time view that computes various time metrics from the event time stamp in the audit table.
  6. The process facts table is created as a view using the previous helper views.

The complete list of commands to create the helper views and tables is included in the code download.


Listing 1. Example of SQL command to create a view of all completed processes
				
CREATE view AUDIT_LOG_PROC_COMPLETED 
as select AL1.piid, AL1.process_templ_name, AL1.event_time, 
'COMPLETED' as state 
from audit_log_b AL1 
where AL1.audit_event = 21004;

As shown in Figure 3, the star schema for creating the processes cube has one facts table and three dimension tables. The facts and dimension tables are related to each other by foreign-key/primary-key relationships, which you will be using when defining the facts-to-dimension joins.


Figure 3. Star schema to create the processes cube
star schema

Having set all the helper views, your next step is to use the Alphablox administration console to define the process and activity cubes. The processes cube is named AuditCube and the activity cube is AuditCube2.

  1. Log into Alphablox, define the data source name for the BPEDB database and the two cubes.
  2. Create the two Alphablox Cubes, AuditCube and AuditCube2 using the facts and dimension tables defined above.

In Figure 4 you can see an example of creating the data source name for the AuditCube. The code download gives you more information about how to set up the cubes without using the Alphablox administration console.


Figure 4. Creating the data source name for the AuditCube in Alphablox admin console
data source

Create a simple portlet to show processes by state

This first portlet displays the states of all processes within a certain time interval. The measure used to display is Process Instances, which shows how many instances of a particular process have completed, failed, or are still running. We used a PresentBlox that shows both the grid and chart of the same data. The number of failed processes is shown in red, to highlight them. The user can customize the appearance of reports interactively using the context menu of each report. The report is shown in Figure 5.


Figure 5. Alphablox portlet to show the deployed processes and their historic states
process states

As shown in Listing 2, the portlet JSP defines a data Blox that connects to the cube, retrieves the appropriate data, and then supplies it to the present Blox, rendering it using both a grid and a chart Blox.


Listing 2. Example of data and present Blox for displaying process states
				

<blox:data
   
  bloxName="<%= dataBloxName %>" visible="false" dataSourceName="AuditCube" 
  query="SELECT DISTINCT({[AuditCube].[Process States].children})ON AXIS(0), 
             DISTINCT({[AuditCube].[Processes].children})ON AXIS(1) 
             FROM [AuditCube] where [Process Instances]"
     ...
</blox:data>

<blox:present visible="false" bloxName="<%=bloxName%>" 
   id="ProcessStatesBlox">
  <blox:grid><blox:cellFormatforeground="red"  scope="{Process 
     States:FAILED}"/></blox:grid>
  <blox:chart title="Process States" chartCurrentDimensions="[AuditCube].
     [Processes]" ... />
  <blox:data bloxRef="<%=dataBloxName%>" />  
     ...  
</blox:present>


Use portlet linking to drill down to process activities

It is often useful to show the states of all the activities associated with a particular process type. You can use the interportlet communication to link the process states reports with the activity states report. We added a hyperlink to each process in the process states report in order to link to the matching activity states report. The activity state report shows how many instances of the associated process activities are in a given state. Figure 6 shows the activities states for the ClaimProcess.


Figure 6. Activity states for the ClaimProcess
activity states

A hyperlink to each process is added by inserting the following code snippet into the present Blox for the Process States portlet.


Listing 3. Insert a hyperlink in a present Blox
				

<blox:present visible="false" bloxName="<%=bloxName%>" 
   id="ProcessStatesBlox">
     ...     
  <bloxportlet:actionLinkDefinition action="setProcessName">
      <bloxportlet:parameter name="name"/>
  </bloxportlet:actionLinkDefinition>

<%
 PortletLink link  = ProcessStatesBlox.getPortletLink("setProcessName");
 BloxModel model   = ProcessStatesBlox.getGridBlox().getBloxModel();
 Controller controller   = model.getController();
 GridEventHandler eventHandler =  new GridEventHandler(link);
 controller.addEventHandler(eventHandler);
%>

</blox:present>

On the receiving end, the Activity States portlet needs to implement the standard actionPerformed() and messageReceived() methods specified in the IBM Portlet API to handle the interportlet communication. Typically, the name of the process can be set at the session scope (or whatever scope fits your application), and the activities states JSP page will customize the report to show the activities of the selected process.


Summary

Reviewing the historic data on your business processes can give you critical insights about how to optimize your business functions. In this article you learned how you can use DB2 Alphablox to quickly create reports using the audit table populated by the WebSphere Process Choreographer. In Part 10 of this series, Tivoli Monitoring for Transaction Performance (TMTP) is used to monitor the transaction performance of the services. You can also further integrate the transaction data collected by Tivoli Monitoring for Transaction Performance and correlate them with the processes and activities data from the BPEL-based business process to get a complete business-to-IT view in the reports.



Download

DescriptionNameSizeDownload method
Set-up files and codei-odoebp12code.zip320 KB HTTP | Download Director

Information about download methods


Resources

About the authors

author photo

Dorian Birsan works on various projects on application development tools at the IBM Toronto Labs. As an Eclipse Platform committer since its inception, he has played an active role in leading the help system and the update manager development. Dorian's current technical interests are SOA technologies and finding simpler solutions to complex problems. Contact Dorian at birsan@ca.ibm.com.

Christina Lau

Christina Lau is a Senior Technical Staff Member at IBM. Christina is an architect on the On Demand Development team focusing on next-generation technologies for the IBM On Demand Operating Environment. You can reach Christina at clau@ca.ibm.com.

Comments (Undergoing maintenance)



Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Sample IT projects, Information Management, Architecture
ArticleID=92489
ArticleTitle=Architecting on demand solutions, Part 12: Use DB2 Alphablox to generate reports for your business processes
publish-date=08302005
author1-email=birsan@ca.ibm.com
author1-email-cc=
author2-email=clau@ca.ibm.com
author2-email-cc=

My developerWorks community

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).