Three steps to monitor your business in real-time using BizTalk and BAM
With some arduous efforts, you finally got to see BizTalk server automates, orchestrates and runs your business process day in and day out. Congratulations! You may see messages/documents come and go, but no one really has a grasp how your overall business is doing. So, you may be wondering "Gee, I wish I can 'see' instantly how my business is doing without even talking to the grumpy IT guys". Bingo, BAM is exactly what you need -- it gives business users visibilities into the running business process without even writing a single line of code!
They're many excellent documents out there detailing how to use BAM (see the documentation links to the right). However, most contents were broken down by roles (admin, developer and business users) and some customers have complained they were somewhat lost when trying to develop their BAM solutions end-to-end. In this post I try to give a simple conceptual overview about how you can leverage BAM to track your business processes.
(Note: left column: files created by or for business users; middle column: BAM tools shipped with BizTalk 2004; right column: BizTalk and BAM artifacts. The blue dash line shows data flow in run-time.)
As illustrated in the diagram above, the first step is to define activities and views using BAM Excel workbook. You make a copy of the BAM workbook template and give the copy a new name, say, "MyWorkbook.xls". You will use this copy to define activities, which mandate what data are to be collected, and views, which describe how the data are to be aggregated. The result workbook captures business users' "interest" in data -- what to collect and how to aggregate.
For example, there may be hundreds of, or even thousands of, data items in a purchase order Xml document sent to you by one of your suppliers. But as a business manager, you may care about only a few of those, such as Purchase Order Amount, Product Category, Customer Location (country, state, city) etc. and you want to organize the data based on location. These payload data will be extracted from the received message in run-time. In addition, you may also want to know when the purchase order is received, approved and shipped by your company. These timestamps are to be collected by the BizTalk server and referred as "Business Milestone" in BAM.
After you go through the wizard in the BAM workbook and define the activities and views, you save the workbook and export the BAM Definition Xml. The exported BAM Definition Xml will be needed in step 3. Please refer to the "BizTalk Information Worker Product Documentation" regarding how to use the BAM workbook wizard.
The second step is to use the supplied command line utility bm.exe to deploy the workbook from the first step. bm.exe does many things for you. In a nutshell, it takes a BAM Definition file (either a BAM workbook or a Xml file) and a BAM Configuration Xml File as input, and dynamically generates the entire tracking infrastructure for you. Simply put, BAM Definition file defines what data to collect and how to aggregate them, whereas BAM Configuration Xml specifies where to deploy your dynamic infrastructure. Generated infrastructure artifacts include SQL tables, views, triggers, stored procedures, Olap cubes and cubing DTS package (if you define measures and dimensions in your view) and archiving DTS package (if you specify the archiving database in your BAM configuration Xml). The tracking infrastructure serves as the data store and the aggregation engine. Note that after deployment, bm.exe also spits out a live data workbook <workbook name>_LiveData.xls, which you use to browse the both scheduled and/or real-time aggregation data.
Up to this point, you have both the tracking infrastructure and UI tool for browsing the data, but you don't have any tracking data yet. This is what step 3 about -- it instructs the BizTalk server to extract the data of interest at runtime and import them into the tracking infrastructure. How do you accomplish this? By the supplied Windows UI tool called Tracking Profile Editor (TPE). You first import the BAM Definition Xml from step 1 and your deployed orchestration assembly into TPE. Then you map each data item in the BAM Definition Xml to the message part in the assembly. The mapping result is called "tracking profile" in BizTalk and can be saved as .btt file. After you're done with the mapping, you deploy the tracking profile back to the BizTalk configuration database. Click here for TPE online help.
Going through the three steps above, now you're ready to monitor your business in real-time. When your orchestration assembly processes next message, it will write tracking data to the tracking infrastructure and you'll be able to see the aggregated data using the live data workbook from step 2. And, did I say you don't need to write any code?
Enjoy your new BAM solution!