[rules-users] Extending objects in declared facts

Mark Proctor mproctor at codehaus.org
Sat Feb 21 17:35:21 EST 2009


J Michael Dean wrote:
> When a fact is declared with propertyChangeSupport in Guvnor, such as 
> following:
>
> declare Hemodynamics
>     @propertyChangeSupport
>     systolicBP: Integer
>     diastolicBP: Integer
>     centralVenousP: Integer
>     wedgeP: Integer
>     status: Boolean
>     alive: Boolean
> end
>
> then the following warning shows up in JBoss console:
>
>  Warning: Method addPropertyChangeListener not found on the class 
> class makeModelTest.Hemodynamics so Drools will be unable to process 
> JavaBean PropertyChangeEvents on the asserted Object
PropertyChangeSupport is only for user classpath beans, we won't be 
supporting it in our generated pojos. We only add it as a tick list 
feature and I don't personally like the feature very much, as notifies 
the engine each time a field is changed, instead as part of a block 
notification.
>
> I implement property changes in a model object so would like to be 
> able to say something like:
>
> declare Hemodynamics extends ModelObject
>     @propertyChangeSupport
>     systolicBP: Integer
>     diastolicBP: Integer
>     centralVenousP: Integer
>     wedgeP: Integer
>     status: Boolean
>     alive: Boolean
> end
>
> The documentation refers to using Guvnor and declarative facts to 
> extend an object that already exists, but not clear that this can 
> actually be done.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>





More information about the rules-users mailing list