IBM Operational Decision Manager Blog
Last week I visited our lab in Littleton, USA (about an hour West of Boston). I got to meet some colleagues that I will be working with over the next 12 months as well as meeting one of our major financial services customers. The customer is looking for guidance as they add major new capabilities (based on rules) to their customer relationship platform. I hope to work very closely with the customer to ensure that we meet or surpass their challenging scalability and agility requirements.
It wasn't all work however, as on Wednesday evening we took a break from meetings to grab a pizza and watch the Celtics beat the Dallas Mavericks at the TD Garden.
John Pingel, a consultant with CoreLogic, recently emailed me with some good questions related to quality metrics for rule projects. Each of these questions deserves a chapter of a book, but I will take a stab at some answers -- please don't hesitate to comment if you have other ideas.
What design/authoring quality metrics can JRules gather for an IRL rule-based system?
Here John was imagining something similar to the common software complexity metrics, such as calculated by the popular JDepends library. Let's see how each could be applied to a rules-based system:
Number of classes and interfaces:Here we can easily calculate the statistics for the rule project, in terms of the complexity of the BOM, VOC, B2X as well as the rules: from Rule Studio export a rule project statistics report.
Afferent Couplings:The way I interpret this is the relative responsibility of a given rule or rule package. I.e. how many rules can a given rule enable?
For example, given the two rules below:
Rule: bar.setDaniel if the name of 'the customer' contains "Smith" then set the name of 'the customer' to "Daniel Selman"; Rule: foo.isSelman if the name of 'the customer' contains "Selman" then print "Hello Dan!";
You can create the following query to discover the data-driven relationship between the rules:
Find all business rules such that each business rule may disable "bar.setDaniel" or each business rule may enable "bar.setDaniel"
As you'd expect, the result of the query is bar.isSelman because the action of the rule will only be fired if the setDaniel rule has been triggered.
Unfortunately we don't currently have queries at the package level or support wildcards in the rule name in the query, so you have to create a query for each rule in your package and then aggregate the results. It should be possible to create a Rule Studio plugin that runs the "each business rule may enable" query on each rule within a package and rolls the results up at the package level. A good starting point for such a plugin is the studio/samples/brmmanagement/queryexecution sample.
An easier way to run the query manually is to right-click on a rule and select "Find Dependencies":
This is essentially the inverse of the above (for this simple example...), showing which rules can cause a given rule to become enabled. E.g.
Find all business rules such that each business rule may enable "foo.isSelman"
I don't think this is relevant for rules.
Here we can use the sample definition as for code: the ratio of efferent coupling (Ce) to total coupling (Ce + Ca) such that I = Ce / (Ce + Ca). This metric is an indicator of the package's resilience to change. The range for this metric is 0 to 1, with I=0 indicating a completely stable package and I=1 indicating a completely instable package.
Distance from the Main Sequence (D)
I don't think this is relevant as we do not have the concept of abstractness.
Package Dependency Cycles
We can interpret this as loops in the "enable/disable" relationships.
If we introduce a third rule:
Rule: baz:setDan if the name of 'the customer' contains "Selman" then set the name of 'the customer' to "Dan Selman";
And for all three rules we run "Find Rule Dependencies > Rules which may enable or disable this rule" we get the following graph:
To detect such cycles our custom plugin would have to walk the dependency graph pushing rules or packages onto a stack. If a rule or package already exists on the stack then we have detected a cycle.
In subsequent posts I will try to address John's other questions:
I just came across Jerry Cuomo's annual WebSphere yearly trends blog post. Every year he posts the emerging trends for the year. One topic of interest was Connecting Business Events, Rules, Decisions and Process. In 2011, WebSphere will continue the integration of rules, events and decisions for both the tooling and runtime. Also exciting is that the integration of JRules in the WebSphere Decision Server made so much sense that WebSphere is also looking at incorporating a rules feature across many of the middleware products. Check out Jerry's 2011 WebSphere Trends
And new this year, the in-house WebSphere band, Mind the Gap produced a music video that presents the trends:
The Global WebSphere Community has also launched an interactive series of open mic webcasts designed to bring the IBM development lab experts to you. The 60-minute monthly GWC Lab Chat sessions will feature a different technology or technology trend each month and provide an opportunity for you to interact with the IBM development lab experts as you relay questions, offer recommendations, voice feedback and opinions and become part of the conversation with the IBM technologists and development teams.
Join us on Wednesday, March 16th @ 11:00am ET as we kick off our first GWC Lab Chat with our host Jerry Cuomo, IBM Fellow, VP and Chief Technology Officer for the IBM WebSphere products as Jerry introduces what is sure to be an engaging conversation on upcoming trends in WebSphere including Business Events and Business Rules.
And don't forgot, if you are interesting in learning more about these trends register to attend the Impact 2011 to hear more from expert speakers.