I'm running into an issue where the || operator embedded in a collect isn't working as expected. My collect statement is as follows...<br> <br> $request : AccessRequest($name : username, $ID : sessionID, $loc : accessLocation, $day : dayOfAccess)
<br> $locationRules : ArrayList(size > 0) from
<br>
collect (AccessRule((allowedLocation == "ANY" || allowedLocation == $loc))
<br>
from $group.getRules())<br><br>I don't get comilation or runtime errors but I don't the expected behavior either. That is, I don'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 <br><br> $request : AccessRequest($name : username, $ID : sessionID, $loc : accessLocation, $day : dayOfAccess)<br> $locationRules : ArrayList(size > 0) from
<br>
collect (AccessRule(allowedLocation == $loc))
<br>
from $group.getRules())<br><br>I get the expected output.<br><br>However, when I modify the rule to look like<br><br> $request : AccessRequest($name : username, $ID : sessionID, $loc : accessLocation, $day : dayOfAccess)
<br> $locationRules : ArrayList(size > 0) from
<br>
collect (AccessRule((allowedLocation == "ANY"))
<br>
from $group.getRules())<br><br>...it returns the empty set even though there are rules that have allowedLocation set to "ANY" (i confirmed this by debugging my java code). I haven'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 == "ANY" embedded in the collect isn't working. What's interesting to note is that the following rule works flawlessly (notice the absence of the collect statement)...
<br><br>rule "test"
<br> when
<br> # does the user that just requested access exist in a group
<br> $request : AccessRequest($name : username, $ID : sessionID, $loc : accessLocation, $day : dayOfAccess) <br> $rule : AccessRule(allowedLocation == "ANY" || allowedLocation == $loc, allowAccess == "true")
<br> then
<br> System.out.println("Test passed");
<br>end<br><br>Any help on the matter would be greatly appreciated. Thanks.<br><br>a<br>