<br> Geoffrey,<br><br> I don't think you need multiple patterns for this specific use case:<br><br>rule "multipleQueensHorizontal"<br>when<br> Queen($id : id, $y : y)<br>
Number( $multipleQueensHorizontal : intValue )<br> from accumulate( $q : Queen(id > $id, y == $y), count($q) );<br>then<br> // do something<br>end<br><br> Am I misunderstanding your use case?<br><br> []s
<br> Edson<br><br><br><div><span class="gmail_quote">2007/7/28, Geoffrey De Smet <<a href="mailto:ge0ffrey.spam@gmail.com">ge0ffrey.spam@gmail.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I 'd like to get the number of queens which have the same y.<br><br>I used to do this with a query:<br> query "multipleQueensHorizontal"<br> Queen($id : id, $y : y);<br> Queen(id > $id, y == $y);
<br> end<br>And then ask the size() of it.<br><br>But now I should be able to do this with the accumulate function:<br> $multipleQueensHorizontal : Integer()<br> from accumulate(<br> $q1 : Queen($id : id, $y : y);
<br> Queen(id > $id, y == $y);<br> , count($q1)<br> );<br><br>However, I get a parsing error on it:<br> Caused by: org.drools.rule.InvalidRulePackage: [31,37]: unknown:31:37<br>Unexpected token ';'[33,6]: unknown:33:6 mismatched token:
<br>[@123,814:814=',',<12>,33:6]; expecting type THEN<br><br>Apparently the ; in of "$q1 : Queen($id : id, $y : y);" is inacceptable?<br><br>--<br>With kind regards,<br>Geoffrey De Smet<br><br>_______________________________________________
<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users
</a><br></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> Software Engineer - JBoss Rules Core Developer<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @
<a href="http://www.jboss.com">www.jboss.com</a>