[rules-users] "or" operator with only one condition??

Bruno Miguel Duarte est-b-duarte at ptinovacao.pt
Tue Jun 5 07:29:50 EDT 2007


Hi Guys,

 

Although doesn't make sense, is there any problem if I write the next
rules?

 

XML:

      <rule name="OR with one condition">

            <lhs>

                  <or>

                        <column object-type="RAFact">

                              <literal evaluator="==" field-name="type"
value="groupId" />

                              <literal evaluator="==" field-name="value"
value="6" />

                        </column>

                  </or>

            </lhs>

            <rhs>

                  System.out.println("Something...");

            </rhs>

      </rule>

 

DRL:

rule "OR with one condition" 

       when

            or RAFact( type == "groupId" , value == 6 )

 

       then

            System.out.println("Something...");

end

 

In my tests, it seems the XML version is accepted (and correct) because
the parser ignores the 'or'!

 

Thanks in advance,

Bruno Duarte

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070605/31b434d1/attachment.html 


More information about the rules-users mailing list