[rules-users] Problems with the declare @propertyChangeSupport Annotation

Oliver Noack oliver.noack at mowli.de
Tue Jul 21 07:56:02 EDT 2009


Hi there,

first some details of my environment, i'm using Drools Guvnor to create 
my rules and a MVC-Java application which accesses these rules. My facts 
are based on the models of the Java application, and are imported in 
Guvnor in a jar-file.

I'm trying to integrate PropertyChangeSupport properly in my current 
project. In a previous version I used the RuleBase and inserted the 
objects with the boolean flag "dynamic" = true:

boolean dynamic = true;
WorkingMemory workingMemory = ruleBase.newStatefulSession();

workingMemory.insert(someObject, dynamic);

This worked flawlessly. But since this is not possible in the Drools 5 
Api I tried to use the @propertyChangeSupport annotation. My idea is to 
declare the metadata for the Object in this way:
http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-expert/html_single/index.html#d0e3571

But the first problem is that I found no possibility in Guvnor to add 
metadata to a Fact Declaration, so for the purpose to test I created a 
temporary DRL File with all my rules and the declaration of the 
@propertyChangeSupport. Somehow like this:

package somePackage
import com.someObject


declare someObject
     @propertyChangeSupport
end

[bunch of rules]

...

But this isn't working, the object's property changes are ignored. Btw. 
the PropertyChangeListener is implemented correctly in the considered 
object. Do you have some hints to point me into the right direction?

Thanks for help,
Oliver Noack




More information about the rules-users mailing list