bam for developers

Download BAM for Developers

Post on 01-Nov-2014

54 views

Category:

Documents

4 download

Embed Size (px)

TRANSCRIPT

Business Activity Monitoring in Depth for DevelopersPublished: January 2009 Authors: Jesus Rodriguez and Joe Klug, Tellago, Inc. Technical Reviewers: Ofer Ashkenazi, Microsoft Marcel Fernee, Microsoft

Stephen Kaufman, Microsoft Brian Loesgen, Neudesic LLC Jonathan Moons, Microsoft Allan Naim, Microsoft Paolo Salvatori, Microsoft Andy Shen, Microsoft

Applies to: BizTalk Server 2006 R2 and BizTalk Server 2009 To download a copy of this document and the sample code, go to

http://go.microsoft.com/fwlink/?LinkId=139086.

SummaryMicrosoft added Business Activity Monitoring (BAM) to Microsoft BizTalk Server as a way for business analysts to track information that is important to them. This paper provides a deep, low-level review of how BAM works and how BAM can be extended. It reviews BAM basics, shows ways in which BAM data can be collected, discusses the BAM infrastructure, demonstrates methods for collecting BAM data, and shows how BAM can be extended to non-Microsoft technologies.

CopyrightThe information contained in this document represents the current view of Microsoft Corporation on the issues discussed as of the date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the date of publication. This White Paper is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation. Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property. 2009 Microsoft Corporation. All rights reserved. Microsoft, BizTalk, Excel, Internet Explorer, MSDN, Outlook, PerformancePoint, PivotTable, SharePoint, and Windows are trademarks of the Microsoft group of companies. All other trademarks are property of their respective owners.

Table of ContentsExecutive Summary....................................................................................................................................... 5 Business Activity Monitoring Overview ........................................................................................................ 6 BizTalk Server BAM: Exploring the activity model .................................................................................... 7 Defining a BAM sample activity model ..................................................................................................... 9 How BAM differs from data warehousing .............................................................................................. 16 Instrumenting Applications by Using BAM ................................................................................................. 17 Using BAM declaratively ......................................................................................................................... 17 Using BAM from BizTalk Server .............................................................................................................. 18 Using BAM from Windows Communication Foundation and Windows Workflow Foundation ............ 22 BAM WF interceptor ............................................................................................................................... 28 Using BAM programmatically ................................................................................................................. 33 BAM event stream API ............................................................................................................................ 33 Using the BAM interceptor API ............................................................................................................... 36 Inside the BAM Infrastructure .................................................................................................................... 39 Storing BAM data: BAMPrimaryImport database ................................................................................... 39 Archiving BAM Data: BAM Archive database ......................................................................................... 41 Partitioning BAM data............................................................................................................................. 41 Aggregating BAM data ............................................................................................................................ 44 The BAM Event Bus ................................................................................................................................. 50 Querying BAM Data .................................................................................................................................... 52 Overview ................................................................................................................................................. 52 Using BAM with data access libraries ..................................................................................................... 53 Using BAM with SQL Server Reporting Services ..................................................................................... 54 Using BAM with Microsoft Office PerformancePoint Server .................................................................. 56 Using BAM with Microsoft Office SharePoint Server ............................................................................. 61 Accessing BAM by using Web services ................................................................................................... 68 Building a BAM RESTful API ........................................................................................................................ 72 Why do we need a new API? .................................................................................................................. 72 Embracing the Web programming principles ......................................................................................... 73 Brainstorming a BAM RESTful API........................................................................................................... 74

A sample BAM RESTful API...................................................................................................................... 76 Summary ..................................................................................................................................................... 85 Authors........................................................................................................................................................ 85

Executive SummaryMicrosoft added Business Activity Monitoring (BAM) to Microsoft BizTalk Server as a means for business analysts to track information that is important to them. One common example of this is tracking the dollar amounts of every transaction processed (i.e., total sales from a particular region). Since BAM was first introduced in 2004, there have been a number of white papers, webcasts, and examples about the basics of BAM. Unfortunately, whats been missing is a deep, low-level review of how BAM works and how BAM can be extended. In this white paper we will take you beneath the covers of BizTalk Server Business Activity Monitoring. After reviewing the basics, we will show you the various methods by which BAM data can be collected, from the pre-built interceptors to the APIs that can be used in custom solutions. The second part of the paper digs into the BAM infrastructure, explaining the BAM databases and what happens to them when BAM models are deployed, and the role of SQL Server Integration Services in BAM. In the third part of this paper we will demonstrate a number of methods for querying BAM data, covering the use of data access libraries, SQL Server Reporting Services, Microsoft Office PerformancePoint Server and Microsoft Office SharePoint Server, and Web services. Finally, this paper covers how BAM can be extended to non-Microsoft technologies through the use of Web services and programming models such as Representational State Transfer (REST). The four sections of this paper are relatively independent of each other. You dont have to read the section on the BAM infrastructure to understand how to extend BAM with REST. Our only suggestion is that you cover the basics at the beginning of this paper. We have also included with the white paper the samples that contain the code that is referenced in this paper. These examples can be compiled and deployed against a basic BizTalk Server installation.

Business Activity Monitoring OverviewBusiness Activity Monitoring (BAM) is one of the rapidly evolving areas of Business Process Management (BPM). Conceptually, BAM focuses on providing nearly real-time monitoring and analysis of business process activities. We can think of BAM as a bridge between integration and business intelligence (BI) techniques. Ultimately, the goal of BAM is to enable sophisticated BI techniques based on the information collected from business processes. In order to achieve this goal, BAM uses BI models based on the information from different business processes. These models are typically known as ev