No Drools 2.x does not support logical Ors - but this is in the 3.0 code
base. It achieves this by converting all possible logic branches of the
OR into sub rules:
http://cvs.codehaus.org/viewrep/drools/drools/drools-core-3.0/src/main/org/drools/rule/LogicTransformer.java?r=HEAD
http://cvs.codehaus.org/viewrep/drools/drools/drools-core-3.0/src/test/org/drools/rule/LogicTransformerTest.java?r=HEAD
The prefered course of action for 2.x is to duplicate the rule for the
different conditions.
Mark
Segal, Jeffrey wrote:
I've pored over the mailing list and website, but I haven't been able to
find any information as to whether Drools currently supports logical ORs
in condition evaluation for domain specific languages. It appears that
the default behavior is to link conditions together with logical ANDs.
E.g., in order for moveObject to fire, all 4 conditions must be true:
<rule name="foo">
<myNamespace:condition nodeRef="node1">
<myNamespace:isObjectOfType objectDef="Map"/>
<myNamespace:isNamed name="bar"/>
</myNamespace:condition>
<myNamespace:condition nodeRef="node2">
<myNamespace:isObjectOfType objectDef="Criteria"/>
<myNamespace:isNamed name="cheese"/>
</myNamespace:condition>
<myNamespace:consequence nodeRef1="node1" nodeRef2="node2">
<myNamespace:moveObject/>
</myNamespace:consequence>
</rule>
If it's not currently supported, are there any future plans to do so?
Thanks,
Jeff