A rule has to ascertain that all elements in a List&lt;ElemBoxStatus&gt;in a<br>Collector occur in the matching BoxResponse&#39;s  Set&lt;ElemBoxStatus&gt;. There is<br>just one BoxResponse per Collector.<br><br>This here works fine:<br>
<br>rule matchCollectorResponse<br> when<br>        $c : Collector( $ebsList : elemBoxStatusList, $gsSet : globalStatusSet )<br>        $b : BoxResponse( collector == $c, globalStatusSet == $gsSet, $ebsSet : elemBoxStatusSet  )<br>
        forall( $ebs : ElemBoxStatus() from $ebsList<br>                BoxResponse( collector == $c, elemBoxStatusSet contains $ebs ) )<br>    then<br>...<br>end<br><br>Thinking that $ebs is already available from the second pattern ($b:...), I tried<br>
<br>rule matchCollectorResponse<br>    when<br>        $c : Collector( $ms : message, $ebsList : elemBoxStatusList, $gsSet : globalStatusSet )<br>        $b : BoxResponse( collector == $c, globalStatusSet == $gsSet, $ebsSet : elemBoxStatusSet  )<br>
        forall( $ebs : ElemBoxStatus() from $ebsList<br>                   eval( $ebsSet.contains( $ebs ) ) )<br>    then<br>...<br>end<br><br>but the compiler came back with<br><br>Line ...:55 no viable alternative at input &#39;$ebs&#39; in rule matchCollectorResponse in pattern eval<br>
<br>Defining a suitable function isIn(...) and using this within eval() produces the same result. This<br>and other experiments seems to indicate that bindings in the first pattern of forall() are not<br>passed in to an eval() later in the forall.<br>
<br>JIRA?<br><br>-W<br><br>