<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Not sure of what you exactly ...<br>
    <br>
    If you want to combine tests, you can write this :<o:p></o:p>
    <div class="WordSection1"><span style="color: rgb(85, 142, 213);">Rule
        &#8220;test filter&#8221;<o:p></o:p></span><br>
      <span style="color: rgb(85, 142, 213);"><o:p></o:p></span><span
        style="color: rgb(85, 142, 213);">When<o:p></o:p></span><br>
      <span style="color: rgb(85, 142, 213);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $cm:&nbsp;
        ConditionMatrix()</span><br>
      <span style="color: rgb(85, 142, 213);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $document:&nbsp;&nbsp;
        ArrayList() from collect ( Document (user.isPrivateName &nbsp;==
        $cm.isPrivateName, </span><span style="color: rgb(85, 142,
        213);">Payment.isLegal == $cm.isLegal) )</span><span
        style="color: rgb(85, 142, 213);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <o:p></o:p></span><br>
      <span style="color: rgb(85, 142, 213);">Then<o:p></o:p></span><br>
      <span style="color: rgb(85, 142, 213);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //do
        something<o:p></o:p></span><br>
      <span style="color: rgb(85, 142, 213);">End<br>
        <br>
      </span></div>
    If you want to make the filter more dynamic and write only one
    "collect" rule, I don't see any out-of-the-box method.<br>
    You can add a method in ConditionMatrix that accepts a Document and
    write this rule :<br>
    <span style="color: rgb(85, 142, 213);">Rule &#8220;test filter&#8221;</span><br>
    <span style="color: rgb(85, 142, 213);"></span><span style="color:
      rgb(85, 142, 213);">When</span><br>
    <span style="color: rgb(85, 142, 213);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $cm:&nbsp;
      ConditionMatrix()</span><br>
    <span style="color: rgb(85, 142, 213);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $document:&nbsp;&nbsp;
      ArrayList() from collect ( Document (eval($cm.accept(this))</span><span
      style="color: rgb(85, 142, 213);"> ) )</span><span style="color:
      rgb(85, 142, 213);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    </span><br>
    <span style="color: rgb(85, 142, 213);">Then</span><br>
    <span style="color: rgb(85, 142, 213);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //do
      something</span><br>
    <span style="color: rgb(85, 142, 213);">End</span><br>
    <br>
    Of course you have to implement the "accept" method in Java (and you
    can then do several sub-classes for you filters)<br>
    <br>
  </body>
</html>