Heiko Braun Software Engineer

Business Process Analytics using BPAF

Over last 6 month I’ve been working on several components that will be assembled to a bigger business activity monitoring solution. I started off with a CEP based activity monitor (SAM) that allows for advanced correlation across heterogeneous event sources. After that I’ve spent some time integrating the BIRT reporting runtime with the BPM console, which allows you to run complex reports on process-related audit data. Only to realize that I’ve started on the wrong foot.

Process analytics bottom to top

I made a mistake to begin with the most complex components first, without realizing that the key to a successful BAM solution is underlying data model. Without a solid baseline the creation of report templates becomes a daunting task because the missing unification of audit data basically requires you to customize the report algorithms for any instrumented subsystem. Creating rules for the CEP component that fire when certain SLA’s are breached doesn’t get more simple either, when working on a heterogeneous event model.

I finally spend some time prototyping around an idea that has been in the wild for quiet some time: Baseline process-related audit data on BPAF: A WFMC standard that describes a data structure that enables the aggregation and correlation of audit data across multiple platforms.

In the following sections I would like to walk through a simple protoype, that already shows the benefits of this approach. It is really impressive how little code it requires to deliver a solution that already matches an important number of the use cases.

Data model, storage and retrieval

To begin with an implementation for storing and querying BPAF event data was needed. Fortunately JAXB and Hibernate made this a trivial task:


@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"eventDetails",
"dataElement"
})
@XmlRootElement(name = "Event")
@Entity
@Table(name="BPAF_EVENT")
public class Event {

@XmlElement(name = "EventDetails", required = true)
protected Event.EventDetails eventDetails;

@XmlElement(name = "DataElement")
protected List<tuple> dataElement;

/**
* A globally unique identifier for the individual event
*/
@XmlAttribute(name = "EventID", required = true)
protected long eventID;

[...]

}

The current implementation allows two approaches for querying the BPAF data: Either leverage the default model and it’s persistence implementation, or adopt a proprietary audit data structure to the BPAF model when needed. For later use case the API fo querying is split from the default data model:


/**
* @author: Heiko Braun <hbraun@redhat.com>
* @date: Mar 10, 2010
*/
public interface BPAFDataSource
{
/**
* Get a list of distinct process definition ID's that are known to the system.
* @return a collection of process definition ID's
*/
List<string> getProcessDefinitions();

/**
* Get a list of distinct process instance ID's that are known to the system.
* @return a collection of process instance ID's
*/

List<string> getProcessInstances(String processDefinition);

/**
* Get a list of distinct activity definition ID's that are known to the system.
* @return a collection of activity definition ID's
*/

List<string> getActivityDefinitions(String processInstance);

[...]
}

Now that we have components in place for storing and querying raw BPAF data, let’s move on to a more interesting topic: How to make sense of it.

Turning data into information

The whole purpose of this exercise is to provide a way to gain insights about the execution characteristics of the processes that drive your business. While BPAF itself is a compact but still very expressive format (BPAF State Model) to store process-related audit data, it requires additional steps to turn it into consumable information that participants and decision makers can make sense of.

For the sake of this example we’ve added some algorithms that allow grouping and sorting of the underlying data, which will be used by the presentation layer.

Let’s take a look at the prototype UI (yet another BPM Console plugin) and see how much information can already be derived without going through hoops and loops.

Presenting audit data to decision makers

The prototype UI demos a simple use case: “How did the processes execute in the past?” Although a simple question, it already implies a lot of fine grained functionality a user might expect: