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.
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
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
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:
- Create a multidimensional data source of the audit table using a star schema.
- Create views on the audit table for the facts and dimension tables.
- 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:
- Using the process states constants defined by BPC, a process states table is created.
- Define the views for the running, failed, and completed processes. (If you are interested in other process states, you can define more views.)
- Define the processes view, which is the union of the running, failed, and completed processes.
- To support various time-related queries, create a view that lists the running time of all the completed processes.
- 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.
- 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
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.
- Log into Alphablox, define the data source name for the BPEDB database and the two cubes.
- 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
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
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
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.
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.
| Description | Name | Size | Download method |
|---|---|---|---|
| Set-up files and code | i-odoebp12code.zip | 320 KB |
HTTP
|
Information about download methods
-
Series overview: Learn more about architecting an on demand operating environment.
-
Part 10: Monitor business IT services using IBM Tivoli Monitoring for Transaction Performance
-
DB2 Alphablox information roadmap for business intelligence architects: Get more information about DB2 Alphablox, including technical documentation, how-to articles, education, downloads, and product information.
-
Develop DB2 Alphablox applications with WebSphere Studio (developerWorks, Jan 2005): Get step-by-step instructions for setting up a development environment for Alphablox using WebSphere Studio Application Developer.
-
Enhanced audit log data analysis and query for BPEL processes with Process Choreographer 5.1 (developerWorks, Feb 2005): Exploit the audit log data written by the business process choreographer.
-
WebSphere Business Integration Server Foundation 5.1.1 Infocenter: Learn more about BPEL and business integration.

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 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)

