[rules-users] Concatenating rule conditions

Vincent Legendre vincent.legendre at eurodecision.com
Wed May 25 10:32:10 EDT 2011


Not sure of what you exactly ...

If you want to combine tests, you can write this :
Rule "test filter"
When
       $cm:  ConditionMatrix()
       $document:   ArrayList() from collect ( Document 
(user.isPrivateName  == $cm.isPrivateName, Payment.isLegal == $cm.isLegal) )
Then
                 //do something
End

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.
You can add a method in ConditionMatrix that accepts a Document and 
write this rule :
Rule "test filter"
When
       $cm:  ConditionMatrix()
       $document:   ArrayList() from collect ( Document 
(eval($cm.accept(this))) )
Then
                 //do something
End

Of course you have to implement the "accept" method in Java (and you can 
then do several sub-classes for you filters)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110525/b2b72469/attachment.html 


More information about the rules-users mailing list