O'Reilly logo

Professional BizTalk® Server 2006 by Ewan Fairweather, Kevin B. Smith, Darren Jefford

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.7. Tracking Interceptor

When developing and debugging rules, it can sometimes be difficult to understand why the BRE is behaving in the way it is. A Tracking Interceptor enables you to understand exactly what the BRE is doing when executing your rules.

Unfortunately, a custom Tracking Interceptor cannot be configured unless you invoke the BRE directly, which therefore precludes the use of the Call Rules shape. You should consider invoking the BRE directly via .NET code, as covered in the "Invoking Rules" section of this chapter.

The interceptor is incredibly useful for figuring out what the rules engine is doing and why. In my view, you should use it on all BRE projects. It will save you a significant amount of time and hassle.

7.7.1. DebugTrackingInterceptor

A DebugTrackingInterceptor ships with the BRE and is located in the standard Microsoft.RuleEngine namespace. This Tracking Interceptor can log tracking information to a text file on disk only.

To make use of the interceptor,you must first initialize the interceptor as shown here by passing a filename for trace output to be written to:

DebugTrackingInterceptor interceptor = new
DebugTrackingInterceptor("TrackingOutput.txt");

You must then configure the BRE to make use of the interceptor by passing it as a parameter to the Policy.Execute method, as follows:

DebugTrackingInterceptor Interceptor = new DebugTrackingInterceptor("output.txt");
Policy Policy = new Policy("Policy1");
Policy.Execute(Facts,Interceptor);

Once configured ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required