[rules-users] drl's and silent failures

Barry Kaplan groups1 at memelet.com
Wed Apr 7 23:15:35 EDT 2010


** warning: This is a rant, but it just might save you some head scratching
if you run into these issues **

I really hate writing rules. Not, well not rules, but rules in the DRL
language. There are so many edge conditions that fail silently. Here just
two from today:

...
then
   retract(f1) // some comment
   retract(f2)
end

In the above retract(f2) will not be invoke. No message about any problems
-- it just doesn't happen. Remove the comment and f2 is retracted. 

And, where 'ksession' is a global

...
then
   update(ksession.getFactHandle(f1), new MyF1(10, 10))
end

In this one the constructor used for MyF1 does not exists. No message, just
silent failure. Change the rule to:

...
then
   MyF1 fi_new = MyF1(10, 10)
   update(ksession.getFactHandle(f1), f1_new)
end

And now the error message about the missing constructor is produced. 

-- 
View this message in context: http://n3.nabble.com/drl-s-and-silent-failures-tp704973p704973.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list