AspAlliance.com LogoASPAlliance: Articles, reviews, and samples for .NET Developers
URL:
http://aspalliance.com/articleViewer.aspx?aId=840&pId=-1
Business Activity Monitoring (BAM) with BizTalk Server 2006 from Start to Finish
page
by Naveen Karamchetti
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 48263/ 102

Introduction

This article describes the most vital feature of BizTalk Server 2006 known as BizTalk Activity Monitoring (BAM).  2006 has several improvements in the BAM area.

Business Activity Monitoring – what does it mean?

Microsoft documentation describes BAM as

“Business Activity Monitoring (BAM) is a collection of tools that allow you to manage aggregations, alerts, and profiles to monitor relevant business metrics (called Key Performance Indicators, or KPIs).  It gives you end-to-end visibility into your business processes, providing accurate information about the status and results of various operations, processes and transactions so you can address problem areas and resolve issues within your business.”

Role of BizTalk

The BizTalk Server 2006 has a component known as the “BAM Portal.”  The various BAM views can be observed and monitored using this BAM Portal.

Target Audience

This article uses BizTalk 2006 and Visual Studio 2005.  It is expected that readers of this article have considerable working experience in these products.

Purchase Order System

In this article we shall be considering a Purchase Order (PO) System.  A PO request is received by the receive location of the PO Orchestration.  A Purchase Order Acknowledgement is generated for every PO request and the PO status is set.  The status of this PO is set, based on upon certain conditions. The various states of the PO are listed below.

·         APPROVED

·         REJECTED

·         ON_HOLD

BizTalk Artifacts

This BizTalk solution consists of the following.

·         Schema – PORequest.xsd & POAck.xsd

·         Property Schema (For exposing the schema properties into an orchestration and ports)

·         Map – A PORequest is mapped into a POAck message.

·         Orchestration – ProcessPO.odx – Sends out a POAck message. (See Figure 2)

Schema

There are two schemas used in this application, a PORequest schema and a POAck schema.

Map

A Map (PORequest-To-POAck-Map.btm) is used to transform a PORequest message to a POAck message.  See Figure 1.

Figure 1

Orchestrations

An Orchestration is essentially a Business Process.  See Figure 2.

The “ProcessPO” Orchestration performs the following:

·         The Orchestration picks up the PO Request message from the receive location.

·         The PO message is transformed into a POAck message.  The status property is set to either APPROVED, REJECTED or ON_HOLD, based on the input values in the PO.  Refer to Figure 2.

·         If POAmount < $1000, then POStatus = “APPROVED.”

·         If POAmount > $ 5000 then POStatus = “REJECTED.”

·         Else POStaus = “ON_HOLD.”

These are fairly simple conditions in order to generate a BAM report.

Figure 2

Preparing the BAM Observation Model

Once the Orchestration is up and running, the data required for the BAM operation needs to be prepared.

The following sequence of steps describes the process of preparing the BAM Observation Model.

Step 1: Create a new XLS file from the “BAM.xla” template.  Locate the BAM.xla file in the following directory in your BizTalk installation, “C:\Program Files\Microsoft BizTalk Server 2006\ExcelDir.”  This shall be the BAM Observation Model.

Step 2: Click on the menu “BAM” and select the menu item “BAM Activity…”

Step 3: The BAM Activity Wizard opens up.  Click on the “New Activity…” button.  See Figure 3.

Figure 3

Specify the Activity name as “PurchaseOrderActivity.”  Add Items to this Activity by clicking the “New Item…” button.  As you might notice, there are several Item Types in an Activity.

 Item Type

Description

Business Milestone

For example, the status of a purchase order request.

Business Data – Text

A string containing any alphanumeric characters.  For example, Ship to: City, State/Province and Zip/Postal code.

Business Data – Integer

A whole number value.  For example, the total number of items in the PO.

Business Data – Float

A decimal value.  For example, the total dollar amount of the PO.

In this example we have defined the various PO statuses as Milestones.

Finally, click on the “OK” button.

Step 4: The “BAM View Creation” wizard opens up (see Figure 4).

Specify the View Name as “POSummary” and select the Activity listed.  Click on the “Next >” button.

Figure 4

BAM View: A BAM View is the set of data you would like to monitor or expose to the various stakeholders of the application.

Step 5: Select the items needed to add to the View.  Choose the “Select all items” checkbox.  Finally, click the “Next >” button.  See Figure 5.

Figure 5

Step 6: Create “Aliases, Durations and Groups” as seen Figure 6.

Durations: Duration specifies the amount of time, defined by a beginning and ending milestone, for a particular activity item.  For example, the number of days a PO is valid.

Milestone Groups: Use a milestone group to put the related milestones together, for example the beginning and end milestones that define how long a Purchase Order is valid.  You can then use the milestone group as a single milestone.

Figure 6

 

Step 7: Create “Dimensions and Measures” as seen in Figure 7.

Measure: The measure is a single value which yields information relevant to process management.  For example, the “TotalPOAmount” measure computes the total value of the PO order.

Dimension: Dimensions are defined in terms of measures.  They put the measure into various perspectives.  For the “TotalPOAmount” measure, it can be made relevant to a PODate, PONum or POStatus by defining in the Pivot table.

Figure 7

 

 

Step 8: This is the “Excel Pivot table.”  Note the Dimensions and the Measures listed in the Pivot table field list as seen in Figure 8.

Figure 8

Step 9: Export the data in the XLS sheet.  Click on the menu “BAM” and select the menu item “Export XML…” and specify a file name “POActivityViewExport.xml.”  Then save it in the local directory.

Deploying the BAM observation model to generate the BAM infrastructure

The BAM observation model can be deployed using this simple command:

BM deploy-all -DefinitionFile:C:\BAMSolution\XlsFile\POActivityViewExport.xml.

NOTE: The file BM.exe is found at the following location.

“C:\Program Files\Microsoft BizTalk Server 2006\Tracking\”

Tracking Profile Editor (TPE)

The TPE is a tool that developers use to create or modify tracking profiles, between items in a BAM activity and the BizTalk solution sources for those items.  The TPE consists of a graphical user interface that allows developers to map a specific view of internal business processes, as well as associated data, to orchestrations and ports using drag and drop experience that does not require the developer to provide code.

The Tracking Profile Editor assumes that at least one BAM definition has already been deployed (using BM.exe).  The Tracking Profile Editor uses a registry key that is set during BizTalk configuration to determine where the Management database is located.

Figure 9

The Figure 9 shows the TP editor used to map the Activity milestones and data with the Orchestration and the message payloads.  Once the mapping is completed, the tracking profile needs to be applied (see Figure 10).  A message confirming the successful application of the profile gets displayed.  See Figure 11.

 

 

 

Figure 10

Figure 11

BAM Portal

The BAM portal in BizTalk Server 2006 provides real-time, end-to-end visibility into a business process.  The BAM portal allows you to perform searches, aggregate data, and set alerts on a BAM view, which is a perspective on your business data.  See Figure 12.

The PivotTable View area displays the PivotTable report that we designed using the BAM Add-In for Excel.

The Pivot table, which we have created in the previous section, would be displayed as shown in Figure 13.  The Chart view of the same pivot table is shown in Figure 14.

Figure 12

Figure 13

Figure 14

 

Downloads
About the downloadable code

Unzip the BizTalk project zip file with the folder names in the C:\ drive.  Use the Bindings file to setup the ports.  Edit the BizTalk project in Visual Studio 2005 and update the Sharepoint connection strings.

The BAM Observation Model is located in the file “C:\BAMSolution\XlsFile\ POActivityView.xls.”

The BAM Observation Model export is Xml file “C:\BAMSolution\XlsFile\ POActivityViewExport.xml.”

Use the batch files to deploy (BM_Deploy.bat) and cleanup (BM_Cleanup.bat) the BAM Observation model.

The Tracking Profile is located in the file “C:\BAMSolution\TrackingProfile\PurchaseOrder.btt.”

The Sample input files are located in the folder “C:\BAMSolution\InputFiles.”

Summary

In this article you have learned how to work with BizTalk Activity Monitoring (BAM), which ships with BizTalk Server 2006, with the help of illustrations.


Product Spotlight
Product Spotlight 

©Copyright 1998-2019 ASPAlliance.com  |  Page Processed at 2019-12-11 7:42:16 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search