1. Problem
You have to set up BAM to
capture data analysis on your BizTalk processes. You need to monitor
these processes and set up alerts based on business process conditions.
2. Solution
BizTalk's BAM tool enables
alerts to be set up based on business data and associated query
conditions. In this sample, you will be setting a BAM alert on a
condition where the sales price of a good is less than $1.
NOTE
BAM alerts rely on the creation of a BAM view deployment.
The following steps show how to create a BAM alert:
Open the BAM portal by navigating to Start => All Programs => BizTalk Server 2010 => BAM Portal Website.
On the portal home page, select the BAM view in the left pane.
NOTE
The portal will display all the deployed BAM views. Alerts are set up per BAM view.
Click the Activity Search link; Figure 1 shows the Activity Search page.
Select your search criteria for the activity, and click Set Alert.
NOTE
It might be a good idea
to execute the query first to provide a sanity check on the query
results. You can set up an alert before or after query execution.
The Alert Details screen will now display. At this screen, enter the details for your alert:
Name: Enter the name of the alert.
Message: Describe the message that should be displayed when the alert is fired.
Priority: Assign relative priority. This would be used as a priority identifier within your solution.
Alert Security: Allow this alert to be seen and used by other users.
Click Save Alert to save the alert details, as shown in Figure 2.
Next,
you must set up a subscriber to identify who should be notified and
when the alert is fired, so click the Add Subscriber button. The Add
Subscriber dialog box appears, as shown in Figure 3.
In
the Add Subscriber dialog box, select the transport option for the
alert. In BAM alerting, you can set up subscribers for either an email
address or a file location.
Click the Save button to complete the subscriber setup.
This
completes the subscriber setup. Now, to review your newly created alert
and subscription, click the Alert Management node under your view. On
this page, you can view a list of alerts and associated alert and
subscription detail, as shown in Figure 4.
Finally,
review that your subscription works. In this sample, you set up a
subscription for a file location. Run your business process with data
that will cause the alert to fire. When this occurs, an alert should be
found in the alert location, as shown in Figure 5.
NOTE
The alert location is a static
location, set up during BizTalk installation. This location should be
shared and assigned with appropriate Active Directory
permissions/security. In this sample, the share location was \\localhost\alerts.
3. How It Works
BAM is a powerful tool in
BizTalk that allows a solution that you can configure to monitor data
passed through BizTalk without performing large amounts of custom
development. BAM is based on SQL Server Reporting Services, and events
are fundamentally triggered via SQL Server Notification Services. You
must consider these prerequisites to successfully enable a BAM
deployment:
Infrastructure:
Ensure your SQL Server environment and Windows server security
configuration are all in working order. This can be problematic and a
necessary step in ensuring a secure environment.
BAM workbook:
A BAM workbook with associated activities must be deployed in order to
access BAM activity searches, aggregations, and associated alerts in the
BAM portal.
Tracking Profile Editor: You must deploy a Tracking Profile Editor to see queries and alerts within the BAM portal.
BAM alerts location: You must specify a location to drop file alerts during installation/setup.
You can configure BAM alerts
for aggregate or individual data conditions. You can create an alert
initially or modify one after creation. An alert can be fired based on a
condition of a row of data or as a condition of a summary of data
(aggregate). To enable this, you have to set up individual data
conditions by setting the alert in the activity search page
(demonstrated in this sample) and set up aggregate alerts via acting on
the pivot table on the Aggregations tab. Figure 6 shows this step.
You can set subscribers for BAM alerts via two transport mechanisms:
Email: Any valid email address or group alias, such as someone@apress.com. A link to the alert detail will be provided in the e-mail body.
File: Alerts will be dropped to the file location specified during product install.
A receive location can be set up
to allow consumption back into the BizTalk process for further
examination and process action. In addition, aggregate alerts can have
threshold limits set to ensure that subscribers are not saturated with
repeated messages.
When deploying alerts, it
is important to remember the testing aspects and notification success.
If a file alert cannot be published as a result of incorrect setup, the
alert can be lost. An error will be indicated in the application event
log. However, the alert instance itself cannot be salvaged.