<br> Wolfgang is right in its suggestion.<br><br> Just to explain what the problem is, in previous versions of drools, forall() could not be used with an embedded from. It is fixed in trunk. <br><br> []s<br> Edson<br>
<br><div class="gmail_quote">2009/3/20 Wolfgang Laun <span dir="ltr"><<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
You don't need forall to solve your problem. The following rule prints all<br>patient names which don't have problem 4711; omitting the 'not' prints<br>those suffering from Colognitis.<br><br>rule lookJoe<br>
when<br> $patient: Patient()<br> not ( Problem( code == "4711" ) from $patient.problemList )<br> then<br> System.out.println( $patient.getName() );<br>end<br><br>'not' implies quantification (or exhaustive search over the domain).<br>
Without 'not' also searches all Problem entries of the current Patient<br>so it would fire again if the patient has a problem stored more than<br>once.<br>
<br>-W<br><br><div class="gmail_quote">2009/3/20 howard goldberg <span dir="ltr"><<a href="mailto:goldberg.howard@gmail.com" target="_blank">goldberg.howard@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">
Trying to check whether a patient has a particular problem on their problem list:<br><br> when<br><br> $patient : Patient()<br> forall ( Problem( code != "195967001") from $patient.problemList)<br>
<br>but I get the following parsing error--<br><br>[29,41]: [ERR 101] Line 29:41 mismatched input 'FROM' expecting ')' in rule "Dumb no asthma Rule"<br>[29,66]: [ERR 101] Line 29:66 mismatched input ')' expecting '(' in rule "Dumb no asthma Rule" in pattern $patient.problemList<br>
<br>What is the correct way to check for this condition?<br><br>Thanks,<br><font color="#888888">Howard<br> <br>
</font><br></div></div>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><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" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>