Agenda groups control only the firing of the rules, not the evaluation.
All the evaluation is eagerly executed as usual in Rete algorithm.
[]s
Edson
2008/2/5, Jai Vasanth <jaivasanth(a)gmail.com>:
Hi,
I am using agenda groups to pick sets of rules to fire based on an
attribute value. The presence or absence of other attributes is dependent
on the value of this attribute based on which I select a particular agenda
group.
Here is an example
rule "ABC"
when
Shape( type = "rectangle" )
then
drools.setFocus("twodimensional")
end
rule "PQR"
when
Shape( type = "cube" )
then
drools.setFocus("threedimensional")
end
rule "area threshold"
agenda-group "twodimensional"
when
Shape( area > 20 )
then
System.out.println ("large object" );
end
rule "volume threshold"
agenda-group "threedimensional"
when
Shape( volume > 20 )
then
System.out.println ("large object" );
end
Suppose if my shape object is a rectangle, then it wouldnt have the volume
attribute. In this case when we try to run these rules it would throw a
NoSuchElementException.
Is there a way to avoid this? Agenda groups help us fire the RHSs
conditionally, Is there a way by which I can conditionally fire LHS of
certain sets of rules ?
Thanks
Jai
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
JBoss Drools Core Development
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @
www.jboss.com