Introduction

Business Activity Monitoring (BAM) is a very good way to monitor a process in BizTalk but often there is not enough time in a BizTalk project to implement BAM because it can take some time to implement it. The advantage of the ESB Toolkit is that you get BAM out of the Box.

The following in the ESB Toolkit you can monitor with BAM without having to do a lot of effort:

 

With pure ESB runtime you don't have reports on the BAM data. The sample give you answers on common questions:

 

Description

In the Charts is information shown about:

 

 

Prerequisites

To use the Charts you must install the BAM definitions for the ESB Toolkit. Follow this sequence to install the prerequisites and to configure your system.

  1. Install BAM itinerary tracking activity definition. BAM itinerary tracking can be used to track the progress and eventual completion of itineraries as they advance through various steps.
    The BAM definition file (Microsoft.BizTalk.ESB.BAM.Itinerary.xml) is located in the BAM folder in the installation directory and can be installed using the Bm.exe tool.
     
  2. Install Exception Handling BAM tracking. The BAM definition file (Microsoft.BizTalk.ESB.BAM.Exceptions.xml) is located in the BAM folder in the installation directory and can be installed using the Bm.exe tool.
     

 

Steps

  1. Create a SQL query on the BAM data.
    The following views in the BAMPrimaryImport database are used in the sample:
     - bam_ItineraryServiceActivity_CompletedInstances
     - bam_EsbExceptions_CompletedInstances
     
  2. Create a class to get the data from the database and put it in a List.
     
  3. Create a Chart on the web page.
     
  4. Put the data from the List in the Chart.
C#
Edit|Remove
public void FormatExecutionTimesChart() 
{ 
    // Get data from BAM database 
    BamManager manager = new BamManager(); 
    List<ItineraryData> executionTimes = manager.GetExecutionTimes(); 
 
    // Get distinct Itinerary names 
    IEnumerable<string> DistinctItineraryNames = executionTimes.Select(x => x.Name).Distinct(); 
 
    // Create Series 
    foreach (string value in DistinctItineraryNames) 
    { 
 
        if (!string.IsNullOrEmpty(value)) 
        { 
            Series s = ExecutionTimesChart.Series.Add(value); 
            s.ChartType = SeriesChartType.Line;   
            s.BorderWidth = 2; 
            s.MarkerStyle = MarkerStyle.Square; 
            s.YValueType = ChartValueType.Int64; 
        } 
    } 
 
    // Add Points to the Chart 
    foreach (ItineraryData iData in executionTimes) 
    { 
        if (!string.IsNullOrEmpty(iData.Name)) 
        { 
            Series s = ExecutionTimesChart.Series.FindByName(iData.Name); 
 
            int index = s.Points.AddY(iData.ExecutionTime); 
            s.Points[index].LegendText = iData.Name; 
            s.Points[index].ToolTip = iData.Date.ToString(); 
        } 
    } 
} 

  

More Information

For more information on Creating a custom BAM Dashboard for the ESB Toolkit, see:

http://social.technet.microsoft.com/wiki/contents/articles/23523.using-bam-in-the-esb-toolkit.aspx