[rules-users] Nested objects

Amin Mohammed-Coleman aminmc at gmail.com
Sat Jul 9 01:39:57 EDT 2011


Hello there

I have the following object model

ClassA
   String name
   ClassB classB

ClassB
   String status
   String context

Before upgrading drools 5.2.0.Final I had the following rule:

when
ClassA ( classB.status =='Open' && name =='Hello' && classB.context='jump')
then
System.out.println("Hit rule");
end

However after upgrading to 5.2.0 the above rule does not get fired, instead I have to do the following:

when
ClassA ( name =='Hello' && classB.status =='Open' &&  classB.context='jump')
then
System.out.println("Hit rule");
end

or 

when
ClassA ( classB.status =='Open' &&  classB.context='jump' && name=='Hello')
then
System.out.println("Hit rule");
end


Has there been a change causing the original rule not to work? Or should the approach always be to use

when
ClassA ( name =='Hello' && classB.status =='Open' &&  classB.context='jump')
then
System.out.println("Hit rule");
end

or 

when
ClassA ( classB.status =='Open' &&  classB.context='jump' && name=='Hello')
then
System.out.println("Hit rule");
end

Any help would be appreciated

Thanks
Amin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110709/70f4fde2/attachment.html 


More information about the rules-users mailing list