0

Using Drools 6.0.1 I would like to set a CONDITION (on a column of a Decision Table) similar to the following one:

ProductDrools(productCategories contains $param)

(that then would go in every rule after a when in a drl file) where productCategories is a Set (e.g. an HashSet) that, for now, I am only able to check against one string per cell e.g. "categoryA".

I would like to provide in the spreadsheet cell a List, array, Set (any Collection) of multiple strings representing categories e.g. "categoryA", "catB", "catX". The official documentation for Drools 6.0.1 does not provide enough information regarding operators like contains.

Is this scenario achievable? How? Is there any documentation regarding this you could point me to?

TPPZ
  • 4,447
  • 10
  • 61
  • 106
  • 1
    There is no operator for testing for an non-empty intersection of two sets. You could create a custom operator, based on the code of "in". – laune Apr 12 '14 at 15:54
  • Oh good to know, thanks. Do you know where to find the source code of that operator? I am kind of lost in all the projects in their Git repositories. – TPPZ Apr 14 '14 at 08:47
  • When you download, you also get some jars containing the sources. See ./org/drools/core/base/evaluators/SetEvaluatorsDefinition.java. Also, you might google "Drools operator definition", although that code was developed for 5.3. – laune Apr 14 '14 at 10:11

0 Answers0