<br>&nbsp;&nbsp; This looks like a bug. Can you please open a JIRA and attach a self contained test you are using to reproduce the problem? This helps us to speed up getting the solution.<br><br>&nbsp;&nbsp; Thanks,<br>&nbsp;&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">
2007/11/7, Adrian Cowham &lt;<a href="mailto:adrian.cowham@gmail.com">adrian.cowham@gmail.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I&#39;m running into an issue where the || operator embedded in a collect isn&#39;t working as expected. My collect statement is as follows...<span class="q"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $request : AccessRequest($name : username, $ID : sessionID, $loc : accessLocation, $day : dayOfAccess)
<br></span><span class="q">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $locationRules : ArrayList(size &gt; 0) from&nbsp;
<br></span>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; collect (AccessRule((allowedLocation == &quot;ANY&quot; || allowedLocation == $loc))
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; from $group.getRules())<br><br>I don&#39;t get comilation or runtime errors but I don&#39;t the expected behavior either. That is, I don&#39;t get the intersection of AccessRules that have allowedLocation equal to ANY or allowedLocation equal to the bound $loc variable. Instead, the empty set is returned.
<br><br>When I modify the rule to look like <span class="q"><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $request : AccessRequest($name : username, $ID : sessionID, $loc : accessLocation, $day : dayOfAccess)<br></span><span class="q">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $locationRules : ArrayList(size &gt; 0) from&nbsp;
<br></span>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; collect (AccessRule(allowedLocation == $loc))
<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; from $group.getRules())<br><br>I get the expected output.<br><br>However, when I modify the rule to look like<span class="q"><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $request : AccessRequest($name : username, $ID : sessionID, $loc : accessLocation, $day : dayOfAccess)
<br></span><span class="q">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $locationRules : ArrayList(size &gt; 0) from&nbsp;
<br></span>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; collect (AccessRule((allowedLocation == &quot;ANY&quot;))
<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; from $group.getRules())<br><br>...it returns the empty set even though there are rules that have allowedLocation set to &quot;ANY&quot; (i confirmed this by debugging my java code). I haven&#39;t seen any documentation that uses the collect statement this way but according to my understanding of the grammer this should work. For some reason the allowedLocation == &quot;ANY&quot; embedded in the collect isn&#39;t working. What&#39;s interesting to note is that the following rule works flawlessly (notice the absence of the collect statement)...
<br><br>rule &quot;test&quot;
<br>&nbsp;&nbsp;&nbsp; when
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # does the user that just requested access exist in a group
<span class="q"><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $request : AccessRequest($name : username, $ID : sessionID, $loc : accessLocation, $day : dayOfAccess)&nbsp;<br></span>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $rule : AccessRule(allowedLocation == &quot;ANY&quot; || allowedLocation == $loc, allowAccess == &quot;true&quot;)&nbsp;&nbsp;&nbsp; &nbsp;
<br>&nbsp;&nbsp;&nbsp; then
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println(&quot;Test passed&quot;);
<br>end<br><br>Any help on the matter would be greatly appreciated. Thanks.<br><span class="sg"><br>a<br>
</span><br>_______________________________________________<br>rules-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<br><a onclick="return top.js.OpenExtLink(window,event,this)" 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>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">
www.jboss.com</a>