Saturday, April 30, 2011

Dynamic Proxy: A simple example

The proxy pattern defined by the Gang of Four (GoF) refers to a structure where a method call of an object (proxy) is actually redirected to a method of another object which is a sibling (inherited from the same parent) of the proxy object. The figure below explains a simple proxy.


A simple proxy

A simple proxy typically implements a single method. There are situations when multiple interfaces need to be implemented by a single class to behave in different ways. Dynamic proxy is a mechanism by which we can achieve the same, provided you follow certain guidelines and restrictions. While I was going thru the JavaWorld artcle (http://www.javaworld.com/javaworld/jw-11-2000/jw-1110-proxy.html) on DProxy, I noticed a case where the author is explaining the dynamic proxy with the example of automobiles.


If a vehicle is considered as a system primarily three categories of users can be thought of for the same – a passenger who rides, a mechanic who repairs and a driver who drives. Each one is concerned with the different perspective of the vehicle. On the other hand the vehicle should also be able to present three different interfaces for these users, such as the driver will be interested in the interface of driving which is presented by steering, gear, break, speedometer etc. Similarly the passenger will be presented with the passenger’s seat, door, window, music, television etc, while the mechanic should be able to inspect and repair the engine, chassis, tyres etc.

I tried implementing the case with Java. I will try to explain the same in this article.

To explain the situation I considered mainly six classes.

1. Drivable interface – To represent the interface of a vehicle designated for drivers.

2. Ridable interface - To represent the interface of a vehicle designated for passengers.

3. Repairable interface - To represent the interface of a vehicle designated for mechanics.

4. Vehicle class - To represent a vehicle that implements the three interfaces mentioned above.

5. VehicleInvocationHandler class - To represent the class responsible for creating the dynamic proxy class and map the methods defined in the above interfaces and the respective vehicle. This class in implementing java.lang.reflect. InvocationHandler class add the feature which will enable it to load the interfaces and the vehicle class dynamically at runtime and map them with each other.

6. DProxyTester class – Representing the client which uses the system as a client.
The figure below explains the structural aspect of the system.

The figure below explains the structural aspect of the system.
Dynamic Proxy: The Automobile Case
From the above structure it’s obvious that the client i.e. DProxyTester will remain unaffected from any changes in Vehicle class.


The Java code for the classes and interfaces are given below.


Drivable.java


public interface Drivable {
     public void drive(String source, String dest, int speed);
}


Ridable.java


public interface Ridable {
    public void ride(String[] passengers);
}

Repairable.java

public interface Repairable {
    public void repair(String[] parts);
}


Vehicle.java


public class Vehicle {

  String name = null;
  public Vehicle(String name){
    this.name = name;
  }

  public void move(String start, String end, int speed) {
     System.out.println(name +" is going from "+start+" to "+end+" at a speed of "+speed+"mph");
  }

  public void carry(String[] passengers) {
     for (String str : passengers)
         System.out.println(name+" is Carrying "+str);
  }

  public void getRepaired(String[] parts) {
     for (String str : parts){
         System.out.print(str+", ");
    }
    if(parts.length > 1){
         System.out.println("are getting Repaired on "+name);
    }
    else{
         System.out.println("is getting Repaired on "+name);
    }
 }
}


VehicleInvocationHandler.java

import java.lang.reflect.*;

class VehicleInvocationHandler implements InvocationHandler
{
    Vehicle vehicle = null;
    private VehicleInvocationHandler(Vehicle vehicle){
        this.vehicle = vehicle;
    }

    public static Object getProxy(String name){
       Vehicle vehicle = new Vehicle(name);
    // the proxy can be provided as drivable, ridable or repairable.
       Class[] interfaces = new Class[] { Drivable.class, Ridable.class, Repairable.class};
       Object proxy = Proxy.newProxyInstance(vehicle.getClass().getClassLoader(), interfaces, new VehicleInvocationHandler(vehicle));
       return proxy;
    }
  
    public Object invoke(Object proxy, Method method, Object[] args){
         if(method.getName().equals("drive")){
               vehicle.move((String)args[0], (String)args[1], ((Integer)args[2]).intValue());
         }
         if(method.getName().equals("ride")){
               String[] passengers = (String[]) args[0];
               vehicle.carry(passengers);
         }
         if(method.getName().equals("repair")){
               String[] parts = (String[]) args[0];
               vehicle.getRepaired(parts);
         }
         return null;
    }
}


DProxyTester.java
public class DProxyTester
{
    public static void main(String[] args){
        Object proxy = VehicleInvocationHandler.getProxy("Bus");
        Drivable d = (Drivable) proxy;
        Ridable r = (Ridable) proxy;
        Repairable p = (Repairable) proxy;
        System.out.println("Dynamic Proxy created... ");
        d.drive("Lombard", "Chicago", 60);
        r.ride(new String[]{"Tom", "John", "Harry"});
        p.repair(new String[]{"Wipper", "Head lights", "Gear Box"});
    }
}

Friday, March 4, 2011

BAM: Capabilities & Applicability (Part 5)

CEP: A Brainier BAM
Complex Event Processing (CEP) is a rising rule-based technology that combines real-time information from distributed message-based systems, applications and databases. CEP dynamically searches for patterns and trends that would otherwise go unnoticed. CEP allows enterprises to identify and predict opportunities represented by outwardly distinct events across complex, heterogeneous IT environments. Figure 5.1 shows how CEP extracts these insights. Businesses capture hundreds of thousands of business events to form an event cloud. These events include, updates to customer records in a CRM application, sales in a point-of-sale application, orders scanned upon shipping or delivery, GPS data for delivery trucks and even weather information. Key features of CEP implementation is the ability to model business activities, specifically the dependencies among servers, network infrastructure, applications, people, and processes. CEP uses these models to identify constraints or patterns that map formal or informal processes to expected outcomes. These models provide a framework for designing, automating, and managing intelligent decisions across the enterprise.

Figure 5.1: CEP delivers insight from enterprise events

Implementing CEP
The steps below are required to implement a CEP solution.

1. Enable the enterprise IT infrastructure to capture events.
2. Correlate/match these events to business objects for context and to determine causality.
3. Create the capability to recognize event patterns.
4. Once patterns are recognized, aggregate pertinent event patterns into higher-level event structures also known as “complex” events.
5. Provide business process models and state-based timing expectations (e.g., timeouts/lack of event support) to represent meaningful process transitions.
6. Create the capability to act/react to drive the business object state to mitigate problems or take advantage of opportunities.

Figure 5.2: CEP Systems are noted for their ability to provide insight into operations in real time. They are iterative and can create new events as patterns of activity from employees, vendors, customers, and other stakeholders

Oracle Complex Event Processing (OCEP)
Among the real-time process monitoring and event processing tools Oracle has offered Business Activity Monitor and Complex Event Processing. One can perform real-time detection of specific patterns, across multiple data streams and time windows, through Oracle Complex Event Processing (CEP). One can also gain real-time visibility into operation and performance of business processes, along with the ability to respond to specific situations, through Oracle Business Activity Monitoring (BAM).


At its core, Oracle Complex Event Processing is a Java container implemented with a lightweight, modular architecture based on the Open Services Gateway initiative (OSGi™). It provides a complex event processing (CEP) engine and Continuous Query Language (CQL), as well as a rich development platform without sacrificing performance.


Architecture Overview of OCEP
Oracle Complex Event Processing is architected as a set of relatively fine-grained software modules. Each module contains a set of Java classes that implement some aspect of the server's functionality. A module may act as a library for other modules by exporting classes for client modules to use. A module may also register services in a service registry for use by other modules. The figure 5.3 shows the high level software architecture of an Oracle Complex Event Processing instance. At the lowest level there is a Java virtual machine with deterministic garbage collection (DGC). The JVM provides the foundation for support of applications that demand deterministic latency by limiting the length of garbage collection pauses. The next layer is composed of the modularity framework which allows modules to control the import and export of Java classes. The modularity layer also handles class loading and provides versioning support for classes. The service framework is responsible for instantiating the classes that implement a service and for resolving dependencies between services.
Figure 5.3: OCEP Architecture Overview

Wednesday, March 2, 2011

BAM: Capabilities & Applicability (Part 4)

On The Way to an Agile Enterprise

In many ways BAM can be considered as a key enabler for achieving agility in the business processes across the enterprise. Agility is all about the sustenance to change. It’s the ability of a business to accommodate and respond to a change faster. BAM can address the key pre-requisites to achieve agility in the enterprise:
• Visibility into daily operations and faster response to variations from the normal trend
• Awareness of change both from external and internal sources
• End-to-end view of the processes with important signs, corrective and proactive measures to be taken by the stakeholders.
Figure 4.1 shows how the BAM solutions and the agility pre-requisites are mapped to the example stated in this article. It’s important to identify the key factors that can increase the agility of the business. For example, the business should focus on external sources that are applicable to the domain and identify the stakeholders who need to get notified on the change and also the people who can act effectively. The more quickly the respond state is reached, the more agility the business will gain.


Figure 4.1: BAM for Agility
Optimizing Business Processes

In a conventional technical way BAM does not have capabilities for performance modeling and application tuning which are the key features of performance engineering. But if BAM is considered from the business process point of view, it provides an approach on how to monitor, tune and track the business processes for performance improvement. This feature in turn adds up in achieving agility, responsiveness and resilience to the business. Eventually these are the vital ingredients needed to optimize the performance of a business process.


Solutions and Implementations

There are several distinct Business Activity Monitoring Solutions present today. Some of them are offered by vendors which are focused exclusively on the Business Activity Monitoring sector such as Systar. Most of the realistic Business Activity Monitoring applications in the market come from the primary enterprise software vendors such as Microsoft, IBM, TIBCO and Oracle. These companies were able to sense the future need of BAM in the marketplace and stapled Business Activity Monitoring capabilities with some of their existing software products. For example Microsoft introduced Business Activity Monitoring features to its BizTalk Server suite, IBM added them to WebSphere; and Oracle enhanced its application server offering with Business Activity Monitoring features. Some popular BAM solutions available today are briefly described below.

TIBCO BusinessFactor: TIBCO BusinessFactor™ software enables the development and delivery of performance visibility and business activity monitoring (BAM) solutions that let users quickly understand current operational performance in context of business objectives, past performance and related activities. It collects and correlates data from across the organization, presents information via customizable interactive dashboards, and alerts users when thresholds are exceeded. By performing these functions, the software helps users more quickly and accurately identify and address risks and opportunities.

It Visual representations of data – including maps, blueprints, technical drawings, charts, or graphs – give users the ability to analyze current conditions and performance for any level of location specificity or timeframe to quickly identify trends and predict likely outcomes. BusinessFactor's intuitive user interface shows critical performance indicators and supporting contextual information so users can perform quick historical analysis, drill into data, and take action. BusinessFactor also gives users the ability to collaborate with other users and interact with systems and processes to take appropriate action.

TIBCO SpotFire: By the way, nowadays TIBCO is promoting a more dynamic product in this area called SpotFire. SpotFire Operations Analytics is designed not only to monitor real-time business events but also to create and deliver root-cause analysis applications in response to those events automatically. Unlike reporting or dashboard based tools, those can only provide alerts on operational problems, SpotFire helps in solving problems, by automatically merging real-time monitored data with contextual information from multiple sources into applications designed to find outliers, trends and relationships.

Oracle Business Activity Monitoring: Oracle BAM is a key technology component of Oracle Fusion Middleware and SOA stack of products. It satisfies a rising need to enable Business Executives and particularly operations managers, to make decisions by making real-time actionable information available 24x7. Visibility into key business metrics empowers managers to improve the efficiency of their business processes in a step-by-step approach to process optimization.

Features of Oracle BAM

The proposed Business Activity Monitoring is Oracle BAM. By deploying the SOA framework and using BAM for monitoring the services, business users can derive actionable timely intelligence on their business operations by monitoring the flow of data, service requests, and process invocations. All the components of Oracle SOA Suite including Oracle BEPL Process Manager (Oracle BPEL PM) and/or the integration adaptors can be configured to sends Oracle BAM information emanating from the various integrated application processes using the JMS protocol. With Oracle BPEL PM this can be achieved by leveraging the built in “sensor” technology wherein a part or the entire state of an instance transaction at a process node can be sent to Oracle BAM as a JMS message for further analysis. Oracle BAM can then correlate disparate events that it received, as messages, within the context of pre-defined monitoring models and rules that can relate to business process KPIs to alert business users of process problems and opportunities.

Architecture Overview of Oracle BAM
The Oracle BAM architecture utilizes messaging, data integration, advanced data caching, analytics monitoring, alerting, and reporting technology to deliver requested critical information within seconds of an event or change in status. Because the primary source of data is messages, Oracle BAM is able to update reports and generate alerts at speeds that traditional architectures simply can’t match. Oracle BAM can accept tens of thousands of updates per second into a memory-based persistent cache that is at the center of the Oracle BAM architecture. Any application can send events using Web services or over any JMSbased messaging protocols. Legacy application can integrate with Oracle BPEL PM using custom created adaptors and can in turn integrate with Oracle BAM via the Oracle BPEL PM native sensor architecture. Oracle BAM can additionally also send alerts to external web services when specified threshold conditions within the analytics engine are met. The figure 4.2 shows the Oracle BAM architecture.
Figure 4.2: Oracle BAM architecture


Business process data can be monitored and tracked using by Oracle Business Activity Monitor. Oracle Business Activity Monitoring (Oracle BAM) is a complete solution for building interactive, real-time dashboards and proactive alerts for monitoring business processes and services. Oracle BAM gives business executives and operation managers the information they need to make better business decisions and take corrective action if the business environment changes.

Figure 4.3: Oracle BAM and surrounding components

IBM WebSphere Business Monitor:  IBM WebSphere Business Monitor (WBM) offers real-time insight into business processes.
WBM extends the extensive distributed platform for monitoring of events native to the mainframe platform. It provides business users with a real-time, end-to-end view of business process performance on user-friendly and customizable dashboards, corporate portals and mobile devices, as well as on the desktop. It can improve business results by enabling business users to preempt problems with predictive KPIs and to detect and manage business situations. It boosts up productivity by empowering business users to create new dashboards, KPIs and alerts with minimal IT involvement. It accelerates continuous process improvement and business innovation through a tight integration with other IBM BPM products.
WebSphere Business Monitor V6.1 provides two types of dashboards: Web-based dashboards and portlet-based dashboards. Web-based dashboards are implemented as Web pages. Portlet-based dashboards are a component of WebSphere Business Monitor V6.1 that operates within the WebSphere Portal V6.0.1.1 environment. Figure 4.4 on and Figure 4.5 illustrate the runtime architecture respectively. As indicated by the flow in both figures, you follow this sequence:


1. After you finish the development of the monitor model, export the resulting monitor application that is deployed into the runtime environment (WebSphere Application Server, WebSphere Enterprise Service Bus, or WebSphere Process Server) by using the WebSphere Administrative Console. Ensure that you configure the WebSphere Business Monitor server application to link appropriately to CEI to be registered to consume events from the emitting application.
2. On another server (for example, WebSphere Process Server or WebSphere MQ Workflow), deploy the application that emits events to a CEI server.
3. Upon receipt of the registered event types, the CEI server sends the appropriate Common Base Event to the server registered in step 1.
4. The monitor model executes. It polls for events waiting on the queue, processes them according to the monitor model instructions, and stores business measures to the Monitor database.
Optionally, the monitor model application can obtain real-time event-related data from the event or data source through code that you can provide and invoke as a user-defined XPath function.
1. Optionally, in addition to receiving events as in step 3, the monitor model application can detect business situations (for example, thresholds) and emit events that can be consumed by the WebSphere Business Monitor action services.
2. The CEI server routes events received through the event or data source or the monitor model application to the action services.
3. The action services component takes action such as sending notifications, calling Web services, and invoking Service Component Architecture (SCA) components to perform actions.
Independently, the business user uses the dashboards, which invoke Representational State Transfer (REST) services to return data from the Monitor database and show monitoring results through different views.


Figure 4.4


Figure 4.4 shows usage of the lightweight Web dashboard, which is implemented as Web pages. DB2 Alphablox package installation is optional and is only the prerequisite for use of the dashboard’s dimensional and report views.
Figure 4.5
Figure 4.5 shows usage of the Portal dashboard, which uses WebSphere Portal Server to invoke a REST service. DB2 Alphablox package installation is optional and is only the prerequisite for use of the dashboard’s dimensional and report views.

Systar Business Activity Monitoring for Telecom: Systar Business Activity Monitoring (BAM) enables telecom firms to go beyond simply monitoring network and IT infrastructure processes, instead delivering a clear, 360-degree view of how incidents affect the health of critical business services that must seamlessly flow together.
Systar BAM enables organizations to improve operational efficiency and service quality through unprecedented real-time insight into core telecom business processes, including: Order fulfillment, Service Activation, Revenue Assurance and Supplier and Partner Service Assurance.

Microsoft Business Activity Monitoring: Pro Business Activity Monitoring in BizTalk 2009 focuses on Microsoft's BAM tools, which provide a flexible infrastructure that captures data from Windows Communication Foundation, Windows Workflow Foundation, .NET applications, and BizTalk Server.
Microsoft BAM allows the user to manage aggregations, alerts, and profiles to monitor relevant business metrics (called Key Performance Indicators or KPIs). It provides an end-to-end visibility into the business processes, providing accurate information about the status and results of various operations, processes and transactions so the users can address problem areas and resolve issues within the business.

Tuesday, March 1, 2011

BAM: Capabilities & Applicability (Part 3)

BAM Matrix

The primary input to the BAM engine can be gathered in a BAM process matrix (table below) that interconnects different systems from business process point of view and also outlines the significant signs to monitor along with the corrective and proactive actions to take in case of contingency. As shown in the third row of the table below, if the estimated delivery date is not generated by the inventory system within three hours of receiving the order, the BAM engine will first fire an API call to check if any detailed status message can be obtained. This will be followed up by sending an email alert to its system owner along with the order and status details. Proactively, the BAM engine can also update the billing engine to delay the billing start date of this order.

BAM process matrix

Integrating Intelligence
A typical business process is influenced by both internal and external sources of information. The BAM model described so far only takes the internal sources of influence into account. The same model can be extended to include external sources of information like weather forecasts, selective news feeds and customized dashboard for manually feeding in intelligence information collected offline. Figure below shows the manner in which this system can be extended.
For instance, when the model depicted above receives some critical weather information about an incoming cyclone, it can update the inventory system to stock appropriate items in the store. Considering another example, the administrator can pull up the list of best selling items during a festival season from the BI system and manually feed it in using the Admin dashboard. At times critical news items can also influence the business process. For instance, in case a popular news source publishes the reviews of a movie with a rating of 5 stars, the systems can send out an alert to increase its inventory. Alternatively, if a stocked movie has really got a bad review, then the stock reorder requests can be put on hold without any manual intervention.

BAM integrated with external systems and feeds for intelligence

Considerations for Implementation

Rolling out a BAM process takes a considerable amount of effort and commitment from the business side. Here are few things for the stakeholders to consider before deciding to go ahead with BAM implementation.

BAM is a Business Solution, Not a Technology Solution: A systematic study of the business processes in context is required as the first step to BAM roll out. Once the study is over a process matrix (table above) has to be created to outline the key stages in the lifecycle of a business entity as it goes through the business process. After the matrix is defined, it will be used to configure the BAM solution to monitor the appropriate significant signs and take the right corrective action. This is purely a business activity and does not have much of technology dependency. It has to be ensured that the required time and effort is committed by the business personnel to make this activity successful.


The idea might need to be sold: A number of existing important business applications might require to get modified for a BAM rollout to be effective. It is important to get the accurate data out of the applications and analyze the same to get precise meaning out of them so that they can be used properly during the BAM implementation. The applications those are architected to be extensible or that follow SOA paradigm will not have many issue in incorporating changes. For the rest, willingness and preparedness to accommodate the changes has to be explained and understood. Most of the time this would require selling idea to all the parties involved and explaining them how the investment will bring in greater benefits to the business.


Compatibility Aspects: Though it sounds very exciting, there is a problem at the last lap of BAM rollout. Since BAM works as a information aggregator, it needs to interact with multiple systems based on the diverse platform and technologies. To avoid the complicacies caused by the heterogeneous platforms and technologies it’s recommended to use web services and SOA paradigm wherever possible during the integration. This would bring in compatibility among the applications running on a heterogeneous environment. While planning for a custom built BAM solution it is very important to consider the needs of the existing applications and the time required to integrate the BAM into the existing environment.


To Start on a Large Scale or Not: For an effective BAM roll out it’s very critical to integrate it with all the systems that participate in the business processes. Before planning for the roll out the complexity of all the candidate systems should be evaluated. Typically all enterprises will have a combination of small and large scale business processes. Small ones will have lesser issues for integration than the large ones. Time and effort required for each of the business processes should be estimated properly. Once the estimation is done the business processes should prioritize based on their sizes otherwise this can put a hold on the business operations for a long period. For example, if the Shipping and CRM systems are found to be the most active ones among the other systems participating in a business process, they should be targeted as the initial candidates for BAM roll out. Once they are integrated with BAM and start to produce results on the BAM reporting interfaces the rest of the systems can be integrated gradually. Another option of the roll out is to break up the business processes in small segments and start the integration in an incremental manner.




Sunday, February 27, 2011

BAM: Capabilities & Applicability (Part 2)

BAM Architecture in General

Architectural diagram on figure below shows general architecture of BAM solution and explain functions of each of them.


Modeling tool

Usually GUI based toolkit is used to define monitor model. The model contains definition of events that should be “caught”, metrics, triggers and KPIs. Finished model is deployed and monitoring can start.


BAM core

This is the main component of BAM solution. It generates event patterns according to the monitor model and deploys them on CEP (Complex Event Processing) engine. It later processes the received event data and transforms them in the desired form. BAM core can also communicate with the Process engine, start and stop the processes, generate events etc. according to triggers and alarms defined in the monitor model.


CEP engine

This is the lowest level component responsible for event filtering. The CEP engine receives query patterns from the BAM core. It queries the event flow both from the Process engine and ESB and sends the “wanted” events back to BAM core. Usually only process engine events are used for BAM, but CEP engine allows also filtering of ESB flow events. That can be used in more technical oriented monitoring, or combined with the business data, to monitor performance, resources usage etc.


Front-end

Front-end receives data already processed, with computed KPIs etc. and takes care of their visualization. Every BAM solution should deliver graphical front-end witch rich visualization possibilities, such as charts, dashboards or graphs. An advanced OLAP-like visualization tool can be also useful. One of the advanced features some front-ends also provide is a real-time view of processes, visualized on process graph. Here you can view process diagram as it was modeled and track the state of a particular process instance. It is also common that at least one front-end should be web based. In this case front-end should provide a possibility to assemble your dashboards “on fly”. This is done usually by AJAX based scripts. AJAX becomes a standard for web-based BI tools today and it is also supported by Jasper Dashboards, one of the hot candidates for open source BAM front-end.


Long term data mining BI tools

An optional component that can analyze data from long-term perspective, realize data mining and knowledge discovery processes. Discovered information is delivered back to BAM core. Mostly external tools are used for such cases nowadays but hopefully in future some of those tools will become a part of BAM solutions. That will allow the feedback obtained by those tools to be sent back to the bam core or the process server.

General architecture for BAM

Where to Apply BAM
A business process typically spreads across multiple large systems which in turn made up of subsystems and components. For example, an order (i.e. a business entity) for a broadband connection flows from one system to another. It goes through some level of transformation while getting processed. The figure 1 shows how an order flows among multiple systems such as CRM, Billing and Inventory etc. to fulfill an order in a typical business process.
Once the order for the broadband connection is placed by the customer online, it flows through different systems on the way to get fulfilled. The basic steps followed in the process above are:

• The order must be validated online for availability and geographical access.
• A broadband router must be shipped from the warehouse to the customer’s address.
• Customer’s phone line and broadband connection must be linked to the same billing account.
• CRM should be updated with the order fulfillment information for the call center to access when providing support to the customer.
The fault with this setup is that each of the systems is autonomous. They have their own alerting and reporting mechanism. This might lead to a scenario where the customer experiences problems with - the delivery of the broadband router in time, unable to receive a discount (if associated) on the combination of a broadband and a land line. Due to the absence of a proper BAM solution the service provider won’t be able to sense these faults before the customers do, causing an unwanted blot in the customer relationship.

In an opposite scenario with a BAM implemented on the service provider’s side:


• The data from not only the systems involved in the business process but also the related subsystems and components can be captured proactively.
• The collected data can be tracked and analyzed against the defined measures.
• Alerts can be raised to the applications and the people when something is not behaving as desired.

How to Employ BAM

To be able to employ a BAM solution effectively the preferred option is to put the entire business process under the supervision of a BPM engine as shown in the figure below.


Business processes executed by BPM
 
This setup can be extended to incorporate a BAM solution as shown in figure below. Under this situation, the BAM adapter is integrated with the BPM engine that in turn is integrated with all the business process systems. The BAM adapter traces the business entity through the business process and keeps comparing it against the standard or defined values. Let us set a KPI for efficient delivery in the abovementioned example, such that an order should not rest within the inventory system more than seven hours. To handle this situation the BAM adapter should track all the orders that go to the inventory management system. If it does not receive a status change notification within seven hours, an email or an SMS alert is sent to the system owner. In case an API (application programming interface) is available to interact with the inventory system, the specific order can be identified and the owner can be notified with an alert on the same. If there is no status change noticed within twenty four hours, an alert (email or SMS) can be sent to the customer with an updated date of delivery.

BAM integrated with BPM infrastructure

This way, BAM brings in agility and resilience in the business, not only that, it can also cut down the burden on the support services by proactively notifying the customers about their order status.
Enterprises that use middleware instead of a BPM infrastructure for business process orchestration can also incorporate the BAM support in their existing setup using an Enterprise Service Bus (ESB) and a logging framework.
In this case, the applications that cater to the part of the business process will require using a BAM logging framework for updating the status of the business entity (e.g. order) through its lifecycle. Multiple instances of this logging framework can be deployed throughout the enterprise and all of them can forward the logging calls to the BAM engine through the use of an ESB or an asynchronous messaging service.

BAM incorporated in a setup with middleware but no BPM


The BAM engine can revive the lifecycle trail of the business entity from these logged messages, trace its progress and raise alerts, alarms and communications as appropriate.

Tuesday, February 22, 2011

BAM: Capabilities & Applicability (Part 1)

Nowadays BAM (Business activity monitoring) is catching up like a mandate for the administration and management for an enterprise. There are few topics that discussed in this article explaining the capability and applicability of a BAM system. The references to the telecom IT sector has been used due to my current involvement in telecom industry.

Proactive data mining

Like other industry verticals the telecom sector depends on the execution of complex business processes. Usually business processes include interactions among multiple heterogeneous IT systems and human resources. The efficiency and success of these business processes in an operational environment can be monitored based on multiple Key Performance Indicators (KPIs) of the business such as customer satisfaction, overall business performance and adaptability to changes. As a reason it is becoming important to monitor the performance of the business processes and optimize them based on the results. Presently businesses come to know about a problem when a failure occurs in the business processes. Monitoring is one of the best ways to sense an imminent problem and avoid it with corrective actions in advance so that, the impact on business and the users can be minimized.
This article will try to present a solution to monitor and optimize the business processes based on the currently available technologies and their maturity.
Purpose of Business Activity Monitoring

The term business activity monitoring was introduced by Gartner, Inc. in 2001 as their notion of aggregation, analysis, and real-time presentation functionality of business relevant information. The main objective of business activity monitoring is to predict or sense the upcoming problem based on the operational transactions and report the same for a preventive measure.
It is becoming increasingly significant in today’s enterprises to consider informed decisions in timely manner by consolidating information present in various silo data sources. These decisions eventually have major impact on the business parameters such as profitability, revenue, customer satisfaction and agility. IT systems like Enterprise Resource Planning (ERP), Customer Relationship Management (CRM), Order Management System (OMS), Business Process Management (BPM), etc. have served with considerable efficiencies in their own areas of the business. However mostly the business processes span across multiple systems.
If we imagine of an enterprise with the capability of foreseeing the next steps, predicting impact of events, sensing an unseen fault by putting two and two together from different systems and eventually spot and plug any hole in the plumbing before the damage is done, a tremendous agility, resilience and efficiency in the business processes can be introduced.
A layer that is able to monitor business processes in the above mentioned manner should be able to understand and perform real time monitoring of vital signs in the context of business process. This monitoring should be made proactive as much as possible. Apart from the failures, the deviations in the normal trends based on the historical data need to be flagged and alerted to appropriate stakeholders with minimum time lag. Among the on-demand features, it should have ad hoc reports, dashboards for the decision making community within the enterprise. Such a layer would bring in manifold benefits.
For example, let’s consider an e-commerce scenario with the key business process of fulfillment of orders placed online. The customer places an order with a set of items and gets notified with a date of delivery. Under a happy path scenario, the customer receives the items on the promised date. Considering a variation when the logistics of delivery such as trucks, delivery boys etc. are operating at the full capacity due to a sudden increase in the number orders placed in, an individual order might get delayed in the delivery. The activity monitoring layer could potentially correlate the high volumes being handled by the system to a potential delay in delivery times. This can trigger an alert or communication to customers informing them about the delay before it actually takes place.
Imagine a more interesting scenario of inventory management for the e-commerce site. Assuming that there is a forecast for thunderstorms for couple of days in some of the areas, the monitoring layer can send an alert to the inventory management group to stock up on rainy weather essentials such as umbrellas and raincoats to enable the business to meet the un-foreseen increased demand.


Components of a Business Activity Monitoring

BAM consists of the following generic components:

Business Event
A business event points to the occurrence of an event that is significant to an operation of a business activity. It is separate from an IT event. An IT event usually shows the occurrence of an event in the context of an IT resource.

Business activity

A business activity offers services or functionalities required to serve a specific business purpose.

Metric

A metric is a measurement of a specific property belonging to business activity that can be used to monitor business operations.


Key performance indicator

KPIs are the metrics used to measure the progress of a business goal. KPIs have to be measurable as well as achievable and provide the possibility to aggregate measures over a set of instances. In order to define KPIs, companies should have clear performance requirements, and they must also have a clear definition of their strategic target which can be compared to runtime values.


Techniques of Today
Though BAM is relatively a new term are some techniques that have been around for a while. The stalwarts amongst these are

• IT system monitors
• Business Intelligence (BI)
• Reporting and Analytics
• Business Process Management (BPM)

Each of the above has its own pros and cons when the BAM features are evaluated. Let us dig a little deeper in these three techniques.


IT System Monitors: To be able to monitor failures and success events at times many enterprises have implemented IT system monitoring measures in effective ways. The main objective of such systems is to alert the support services in a timely manner to meet the service level of agreement and availability levels of the application. This technique targets individual applications for monitoring and helps them to react under a error condition at the application level. While it does not consider the entire business process as a monitoring target as a result it is unable to track any fault at the business process level. IT system monitors are mostly reactive than proactive. They keep watching the applications, logs, network, server, hardware in isolation for faults rather than the end-to-end business process. IT system monitors will be unable to detect an error at the business process level while the applications are running smoothly. IT system monitors watch for the malfunctions and failures only, while an ideal BAM should look for success and failures both to yield meaningful activity metrics. They are also not aware of the business process level KPIs (Key Performance Indicators).
For example, if a customer is promised with the certain duration for an order fulfillment process, a KPI needs to be set at the business process level for order processing. IT system monitors are unable to detect a degradation of this kind of KPIs. The scope of alerts is limited to the application and does not correlate to failures in other participating application in the same process. It is also unable to detect any variation in the business process when the applications are functioning properly.
In spite of all shortcomings these tools have been serving as monitoring instruments for many organizations. In fact there have been conscious design efforts introduced to log success events (along with the failures) in individual applications’ logs against a unique correlation id and also a listener mechanism to poll the logs in a timely manner and correlate the events using the unique id for each business process transactions. However since the number of I/O operations increase (due to write in log and timely polling of listeners), the performance of the applications is compromised seriously under this situation.


Business Intelligence (BI): Business Intelligence has been occupying the place of a backbone for decision making process of the organizations for quite some time now. This is due to its capabilities of analytics and extensive reporting. BI is capable of processing enormous amount of data stored in huge data marts at predefined frequencies by using ETL (Extraction Transformation and Loading) tools and put the same into the data stores which gets reported eventually. This way BI enables businesses to make informed decisions to a great extent. However when it comes to BAM some constraints apply.

• Since BI and data warehousing are based on batch processes, proactive and real time decisions can not be made easily using BI.
• The statistical analysis is performed manually in BI. Since the monitoring framework is not updated with the historical trends, it’s not able to flag events which are deviating from the normal trend.
• Since BI is not a real time system, it can not track real time errors or deviations and generate alerts for that.

Business Process Management (BPM): Enterprises use business process management to manage, model and automate business processes. Externalization of all business processes those are entrenched deeply in applications to a central location is one of the main tenets of using BPM. BPM accomplishes quite a lot from that angle in terms of improved process agility and centralized governance of vital processes. But BPM also has some shortcomings as a BAM solution:

• BPM has no built in monitoring capabilities. Therefore, alerts based on the success or failure of a process can not be generated by the BPM infrastructure. Furthermore the success and failures can not be evaluated against the historical trend to compose intelligent reports necessary for the right changes or decisions to the activities.
• BPM has the knowledge of a business process while it is lacking the knowledge of relationship between the participating applications, historical data and statistical analysis which are required for anticipating the unknown errors in a business process.

The table below presents a comparative analysis of the BAM techniques described above. It also shows the rating of the three techniques as an ideal BAM solution.


Table 1: Comparative analysis of three BAM techniques