Feeds

Writing the Rules

The rules engine that's best for your business

The Power of One Brief: Top reasons to choose HP BladeSystem

JBoss Rules 3.0.5

JBoss's Rules technologies are part of its JEMS (JBoss Enterprise Middleware Suite) SOA platform, and are already in wide use. JBoss sees customers using the tools to help implement service architectures, as rules can be used to link and orchestrate services. Version 3.0.5 was released in November 2006, and while it may not have all the features of some of its competitors, it has the advantage of offering a range of interfaces and is small enough to be embedded in existing applications – rather than requiring its own server. It's also open source, so you can tailor it to work just the way you want. There are some useful publications on the technologies used in JBoss Rules here.

Developing new rules is relatively easy, and JBoss provides an Eclipse plug-in to add rules development features to existing IDEs. As JBoss Rules is an extension of the Drools project [the Drools project voted to join forces with JBoss at the end of 2005 – Ed], you'll need to become familiar with JBoss' Drools business engine language (and you'll find plenty of references to Drools in the copious online documentation). Drools provides forward chaining, using fact propagation to provide a conclusion which is then acted on by an application. The Eclipse IDE hides Drools' XML syntax, providing a more readable UI; you can still edit the XML by hand, but we&'d recommend using the IDE tools. You can use the JBoss site as an update server, making sure you always have the latest version of the IDE installed in your copy of Eclipse.

While it may not be as business-user-friendly as ILOG's JRules, JBoss Rules can be used by non-developers. Its business language offers BASIC-like functions, and hides the Java and XML code needed to implement rules in your applications. The application is JSR 94 compliant, simplifying integration with existing applications and application servers. One significant omission is a rule repository. While you can use existing source control tools, like CVS, to manage rules, this approach adds an extra layer of complexity, and could discourage business users.

Building rules is relatively easy. Like languages on other rules engines, the Drools language is declarative, and decouples business logic from data. Left hand and right hand sides link facts to actions. Rule sets are delivered as packages, and include declarations, variables, functions and rule definitions.

While Drools uses the Rete algorithm to execute rules, developers don't need to be familiar with the approach – though it can help in defining rule sets when filtering facts. There's also support for Leaps, an algorithm which can speed up rules processing. You can define activation groups in JRules, which will group several rules so that if one fires, the rest will be ignored; an approach which works well when managing rule priorities. JBoss's documentation shows the open source nature of the project, with lots of theoretical detail alongside sample code.

Rules are first authored, and then parsed to ensure the rule grammar is correct. Once parsed, the rules are packaged and can be deployed in a runtime RuleBase. You can access the resulting RuleBase from your Java code: facts are delivered as Java objects, and can be asserted or retracted. If you're using decision tables, you can build them in Excel or other spreadsheets – a useful approach which helps business users get to grips with rule definitions in a familiar environment.

Like most JBoss tools, JBoss Rules is free to download. Community support is available online and through a wiki. If you need more support, you can purchase support from JBoss, which will give you access to the development team. If you're customising JBoss Rules or building it into your applications, you'll probably need this level of support.

Development is fast, with new versions released regularly. The next major update, JBoss Rules 3.2 will be released in Q1 2007, and will add new elements to JBoss' rules language, as well as improving the IDE and adding new debugging tools. Future versions will add the missing rule repository, along with a web-based rule development UI.

The ultimate aim of the JBoss team is to deliver a full business management suite. JBoss Rules is part of this vision, though it still falls short of delivering the whole picture. While the current rules engine may not have as many features as its competition, JBoss Rules is a powerful tool, and one that can be used by any Java developer who wants to add a rules engine to an existing application without significant investment. JBoss Rules isn't quite ready for enterprise heavy-lifting, but it certainly packs a hefty middleweight punch.

Seven Steps to Software Security

More from The Register

next story
Secure microkernel that uses maths to be 'bug free' goes open source
Hacker-repelling, drone-protecting code will soon be yours to tweak as you see fit
KDE releases ice-cream coloured Plasma 5 just in time for summer
Melty but refreshing - popular rival to Mint's Cinnamon's still a work in progress
NO MORE ALL CAPS and other pleasures of Visual Studio 14
Unpicking a packed preview that breaks down ASP.NET
Cheer up, Nokia fans. It can start making mobes again in 18 months
The real winner of the Nokia sale is *drumroll* ... Nokia
Put down that Oracle database patch: It could cost $23,000 per CPU
On-by-default INMEMORY tech a boon for developers ... as long as they can afford it
Another day, another Firefox: Version 31 is upon us ALREADY
Web devs, Mozilla really wants you to like this one
Google shows off new Chrome OS look
Athena springs full-grown from Chromium project's head
prev story

Whitepapers

Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Consolidation: The Foundation for IT Business Transformation
In this whitepaper learn how effective consolidation of IT and business resources can enable multiple, meaningful business benefits.
Application security programs and practises
Follow a few strategies and your organization can gain the full benefits of open source and the cloud without compromising the security of your applications.
How modern custom applications can spur business growth
Learn how to create, deploy and manage custom applications without consuming or expanding the need for scarce, expensive IT resources.
Securing Web Applications Made Simple and Scalable
Learn how automated security testing can provide a simple and scalable way to protect your web applications.