I have in the working memory all possible sentences that can be presented to the user ( class Sentence() ).

Each sentence holds a collection (String collection) called descriptor that describe the sentence.

 

Based on  various rules I populate a collection called messageFilter which will be used to select the appropriate sentence.

The proper sentence is one that all its descriptors match the one in the messageFilters

 

What I would like is something of the sort:

 

$sentences:       ArrayList()

from collect (Sentence(descriptor contains messageFilter)

                                                                                         

as messageFilter is a collection, this is not a valid code.

What would be the proper method to implement it.

 

I am using drools 5.1.1 but am willing to upgrade to 5.2 if required.

 

Thanks,

Hezi