Rule Vendors – Product Derby

Rule Vendors – Product Derby

Once a year, during the business rules symposium, vendors of rule engines can show how they implement a general use case that contains many business rules. This use case is known as the UServ Product Derby. You can read the specifications here.

A few years ago I was actively involved with the implementation using Aion (from CA). Last year I put together the web front-end for Corticon. And recently I’ve been examining the implementation from Microsoft with WF rules.

Microsoft’s example (download here) illustrates the technical feasibility of using WF rules. Although the WF rules example does show that it’s technical possible, it does a poor job on making these rules accessible and understandable by business users.

For me it was a nice opportunity to see if the Rule Manager from Acumen Business could actually show the rules and perform rule verification on the policy to discover any anomalies. We start this blog series with a closer look at the ‘Driver’s Eligibility’ policy as defined in the use case. After a few adjustments on the Rule Manager, I produced this report (PDF, XPS) from Microsoft’s example implementation.

The part that got my attention right away was the discovered contradiction. On first look, the rule with the unfriendly name ‘DA_7’ is rather complicated. It is a typical programmer’s construction to use a not (expr and expr)
Such a statement has probably a few nanoseconds advantage on your processor. However do we really want the business user to decipher this statement by applying De Morgan’s law?

Just keep is simple stupid. Where possible, avoid negated rule expressions and split or-statements in multiple rules.

You might wonder if we found an error with the rules example? The example works fine, however Microsoft uses rule priorities to ensure that rule DA_7 (priority -1) , is executed before DA_8 (priority 0). The problem that I have with rule priorities is that you throw away the declarative feature of the rule engine. Suddenly the rule writer has to be aware of priority values in order to achieve the desired result.

Also note that DA_7 does not halt the rules engine. So in a case where we have a male driver of 71 years old Microsoft rule engine will first assign ‘Typical Driver’ to the Driver class, and overwrites this value with ‘Senior’. Not very elegant, because now we also have to make sure that rule ‘DA_4’ must be executed after DA_7 and DA_8. If DA_4 would fire before, we make the incorrect conclusion that a 71 year old senior is eligible without checking his training certificate. Can somebody explain the word declarative? It’s obvious that we lost the baby with the bath water. So please only use priorities if you really have to. And we will show below that these few rules really don’t require rule priorities.

Finally, we see two disjoint rule networks in the Rule Network Graph! We have to wonder what happened with the rules that determine the ‘Training Certification’. And also how the DUI is related to the Training Certificate? Did they use the same specification?

Again, Microsoft example was only illustrating the technical aspects of WF rules. And the example shows how you can achieve First Order Logic with WF rules. (For All Drivers do…)
I will write in a later blog entry, how we are solving the First Order Logic with the Rule Manager.

If we would have just followed the Use case business rules specification, it’s all not that difficult. I always try to stay as close to the initial definition. Here is a produced report of my rewrite (PDF, XPS).

There are no disjoint rule graphs, no self contradictions within the rules, and no rule anomalies among rules. We do discover some incompleteness. E.g. is a Female of 24 years old eligible?
This incompleteness is probably my misinterpretation of the use case specification. But with this report it’s very easy to get these few issues clarified.

Launching HAT with a specific view…

Have you ever created a custom monitoring or troubleshooting tool (or data store)
for working with BizTalk, and wanted the ability to launch the HAT (Health and Activity
Tracker) tool in a particular context?  Here are the command line parameters
that will enable you to do just that…

First, though you can typically launch the HAT tool from “C:\Program Files\Microsoft
BizTalk Server 2006\BTSHatApp.exe”, for a production tool you probably want to read
the install location of BizTalk from the registry at “SOFTWARE\Microsoft\BizTalk
Server\3.0\InstallPath.”

The command line syntax looks like:

BTSHatApp.exe “btshat:“ViewName:<OrchDebugger|MessageFlow|SvcInstQuery>
MgmtSvr:<your server> MgmtDb:<your mgmt db> SvcInstId:<service instance
id> [MsgId:]<optional msg id>””

OrchDebugger and MessageFlow bring up the expected HAT views that you are familiar
with.  SvcInstQuery will actually open the BizTalk Admin console, with a query
set up so you can see a live service instance with associated messages, etc.

You can also launch with the name of a saved tracking query, as in:

BTSHatApp.exe "c:\program files\microsoft biztalk server 2006\tracking\queries\MessagesSentInPastDay.trq"

The BizTalk management pack for Microsoft Operations Manager appears to use this command
line interface so that it can provide built-in tasks to launch HAT with the context
present in captured event log entires.  This means that if you have the MOM operator
console installed on a machine that is joined to a BizTalk group, you have a
nicely integrated set of troubleshooting tools.

Launching HAT with a specific view…

Have you ever created a custom monitoring or troubleshooting tool (or data store)
for working with BizTalk, and wanted the ability to launch the HAT (Health and Activity
Tracker) tool in a particular context?  Here are the command line parameters
that will enable you to do just that…

First, though you can typically launch the HAT tool from “C:\Program Files\Microsoft
BizTalk Server 2006\BTSHatApp.exe”, for a production tool you probably want to read
the install location of BizTalk from the registry at “SOFTWARE\Microsoft\BizTalk
Server\3.0\InstallPath.”

The command line syntax looks like:

BTSHatApp.exe “btshat:“ViewName:<OrchDebugger|MessageFlow|SvcInstQuery>
MgmtSvr:<your server> MgmtDb:<your mgmt db> SvcInstId:<service instance
id> [MsgId:]<optional msg id>””

OrchDebugger and MessageFlow bring up the expected HAT views that you are familiar
with.  SvcInstQuery will actually open the BizTalk Admin console, with a query
set up so you can see a live service instance with associated messages, etc.

You can also launch with the name of a saved tracking query, as in:

BTSHatApp.exe "c:\program files\microsoft biztalk server 2006\tracking\queries\MessagesSentInPastDay.trq"

The BizTalk management pack for Microsoft Operations Manager appears to use this command
line interface so that it can provide built-in tasks to launch HAT with the context
present in captured event log entires.  This means that if you have the MOM operator
console installed on a machine that is joined to a BizTalk group, you have a
nicely integrated set of troubleshooting tools.

LoadGen

LoadGen

LoadGen is a Microsoft tool that can be used to generate test inputs to BizTalk solutions. The two features I really like about it are Message Creators, which allow you to generate different messages in each run (for example, different request id’s, guid’s, etc. in every generated file/message), and the Load Generators/Transports, which allow you to generate files, Http or Soap requests, Msmq messages, etc. A third architectural component are Throttlers, which allow you to regulate the rate at which documents are generated.

Load generation is just the first part of the problem when testing a BizTalk solution, however. You must have a way to measure how your solution is holding on, and for this a typical approach is using Performance Counters.

The download includes several samples, however most of these omit the configuration of Message Creators, which took me some time to get working. One thing to remember is that you can/should include the configuration of the Message Creator inside a Section block, at its end.

Here are some other quick tips:

  • LoadGen writes (verbosely) to the Event Log. Check it to find out if something is wrong with your configuration, for example.
  • In the documentation for Message Creators (“Dynamic Message Creation”), the MessageCreator/Field/InitialValue Xml element contains a simple replacement string: if the source file contains IDField_0, this will be replaced by the value generated by the configured MessageCreator. The documentation talks about this being a “field name“, which is not totally clear.
  • The MessageCreator/TemplateFilePath element should point to the configuration for the Message Creator, and not to the Template for document generation. It’s a bit mis-named.
  • If you have a Section for generating files, with a Message Creator within it, you have two references to the template file for your documents: in the Message Creator configuration file, the element MessageCreator/@SourceFilePath, and in the Section you have Section/SrcFilePath. This can get a bit confusing.

In my tests, I wanted to generate values with specific formats, so I decided to write an additional Message Creator. What I found out was that it was way quicker to disassemble the out-of-the-box CustomMC assembly and extend it than write one from scratch. Not exacly recommended and probably not supported/allowed, but… quick. I used Reflector.Net and the File Disassembler add-in.

LoadGen is a nice tool, but it’s only the beggining of your work. Now, what I would really like to see is something like this being used in conjunction with BizUnit :-).

Just another suggestion: Scott Colestock did a session at last year’s SOA conference I recommend, on this testing topic: %u00abApplying Maximum Sustainable Throughput to a Management/Operations Strategy%u00bb. Slides are here.

VMRCplus – Virtual Server cool WinForm based App now public!

If you’re like me and run a few virtual machines each day, then running them with
ease is key I reckon.

Generally I’ve found on dual core machines etc. virtual server makes better use of
multi-cpu based hosts than what Virtual PC2007 does (VMWare vs VPC is another debate
🙂

The only draw back is that I’ve always had to setup this IIS based website and it
gets painful, particularly on a laptop etc. when all sorts of things get installed
and uninstalled etc. IIS sites sometimes stop working and thus your only lifeline
to the running virtual machines.

Well VMRCplus is the answer! (This used to be an internal MS tool
which it looks like they’ve released to the public)

YOU DO NOT NEED IIS with this baby – it uses the COM Api behind the scenes.

Grab it here……..

VMRC
PLUS

Some features to wet your appetites:

    • Direct control of local or remote instances of the Virtual Server service. IIS and
      IE browser are no longer required!

    • Tabbed interface to quickly jump between Virtual Server hosts and guest VMRC sessions.

    • Reusable saved states: this feature allows users to preserve a particular saved state
      and return to that state at any time.

    • Multiple guest selection supported for startup/shutdown/save/display.

    • Browse button navigation for media, hard disk images, ISO images, .VMC files, etc.

    • Drag and Drop support for .VMC files, ISOs images, VHD and VFD files.

    • Resizable desktop support for guests running Virtual Machine Additions (maximize VMRC
      window supported).

    • Limited cut and paste of text from host to guest (only).

    • A built-in utility to take JPG screenshots of running guests. Useful when filing bugs.

    • Built-in error notification with Virtual Server eventlog viewer.

    • A Virtual Networks Manager and Virtual Disks Manager that cover all features.

    • Keyboard shortcuts (e.g. Ctrl-S to save state a guest).

    • Create multiple guests at once.

    • Create guest from parent (or multiple guests)!

    • Automatic reconnect to a designated Virtual Server host.

    • Toolbars in both Guest and Console Manager for quick access.

    • Unlimited number of guests.

    • Maximum of 32 Virtual Server hosts.

    • Sorting on columns of guests so you can sort based on status and multi-select.

    • Automatic detection of Virtual Machine Additions and notification.

    • Detection of Virtual Server 2005 R2 SP1.