Certainly, and it&#39;s more to the point - thank you!<br><br>Nevertheless, the compiler hiccup ought to be investigated<br>-W<br><br><br><div class="gmail_quote">On Wed, Sep 2, 2009 at 5:31 PM, Greg Barton <span dir="ltr">&lt;<a href="mailto:greg_barton@yahoo.com">greg_barton@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Is Collection.containsAll() an option?<br>
<br>
--- On Wed, 9/2/09, Wolfgang Laun &lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt; wrote:<br>
<br>
&gt; From: Wolfgang Laun &lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;<br>
&gt; Subject: [rules-users] forall/from/eval/contains: odd DRL syntax error<br>
&gt; To: &quot;Rules Users List&quot; &lt;<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>&gt;<br>
&gt; Date: Wednesday, September 2, 2009, 9:58 AM<br>
<div><div></div><div class="h5">&gt; A rule has to ascertain that all elements in<br>
&gt; a List&lt;ElemBoxStatus&gt;in a<br>
&gt; Collector occur in the matching BoxResponse&#39;s <br>
&gt; Set&lt;ElemBoxStatus&gt;. There is<br>
&gt; just one BoxResponse per Collector.<br>
&gt;<br>
&gt; This here works fine:<br>
&gt;<br>
&gt;<br>
&gt; rule matchCollectorResponse<br>
&gt;  when<br>
&gt;         $c : Collector( $ebsList :<br>
&gt; elemBoxStatusList, $gsSet : globalStatusSet )<br>
&gt;         $b : BoxResponse( collector == $c,<br>
&gt; globalStatusSet == $gsSet, $ebsSet : elemBoxStatusSet  )<br>
&gt;<br>
&gt;         forall( $ebs : ElemBoxStatus() from<br>
&gt; $ebsList<br>
&gt;                 BoxResponse( collector ==<br>
&gt; $c, elemBoxStatusSet contains $ebs ) )<br>
&gt;     then<br>
&gt; ...<br>
&gt; end<br>
&gt;<br>
&gt; Thinking that $ebs is already available from the second<br>
&gt; pattern ($b:...), I tried<br>
&gt;<br>
&gt;<br>
&gt; rule matchCollectorResponse<br>
&gt;     when<br>
&gt;         $c : Collector( $ms : message, $ebsList :<br>
&gt; elemBoxStatusList, $gsSet : globalStatusSet )<br>
&gt;         $b : BoxResponse( collector == $c,<br>
&gt; globalStatusSet == $gsSet, $ebsSet : elemBoxStatusSet  )<br>
&gt;<br>
&gt;         forall( $ebs : ElemBoxStatus() from<br>
&gt; $ebsList<br>
&gt;                    eval( $ebsSet.contains(<br>
&gt; $ebs ) ) )<br>
&gt;     then<br>
&gt; ...<br>
&gt; end<br>
&gt;<br>
&gt; but the compiler came back with<br>
&gt;<br>
&gt; Line ...:55 no viable alternative at input &#39;$ebs&#39;<br>
&gt; in rule matchCollectorResponse in pattern eval<br>
&gt;<br>
&gt;<br>
&gt; Defining a suitable function isIn(...) and using this<br>
&gt; within eval() produces the same result. This<br>
&gt; and other experiments seems to indicate that bindings in<br>
&gt; the first pattern of forall() are not<br>
&gt; passed in to an eval() later in the forall.<br>
&gt;<br>
&gt;<br>
&gt; JIRA?<br>
&gt;<br>
&gt; -W<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; -----Inline Attachment Follows-----<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
<br>
<br>
<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>
</blockquote></div><br>