Nov 17

In JBoss Drools you can use Functions to simplify rules and to DRY:

function int monthlyPayment(Money initialMonthlyPayment) {
    return initialMonthlyPayment.times(0.75);
}

We used this technic for some little helpers. We unit test all our rules and everything seems to be fine until our customer did some more monkey testing. He claimed that some rules worked once but fail now. After some root cause analysis we found a very strange bug (JBRULES-2749). Rules won’t fire! Luckily we found this bug before our go live.

Don’t use Drools functions until this issue is solved. Instead use a static method in a helper class.

Drools is really a cool rule engine, please vote for JBRULES-2749.

Leave a Reply

preload preload preload