Q:

Drools: create a conditional rule to match an input as list for each condition with permutations and combinations

In Drools how do I create a conditional rule to match if 
1) input is a list.
2) each condition column will has its own list 
3) Condition should match in permutations and combinations of all condition lists 
If my decision table is in below format 
------------------------------------------------
COND.  |  CONDITION  | CONDITION| ACTION
------------------------------------------------
Store |  ProjectCode | Country  | ArticleNumber  
------------------------------------------------
10    |   1001       |   USA    |   AD112
20    |   1002       |   UK     |   AD113
30    |   1003       |   USA    |   AD114
40    |   1004       |   SWE    |   AD112
50    |   1005       |   GER    |   AD114

I will have conditions in list form like below
ArticleRule{
List<String> stores = Arrays.asList("10","30","40","50");
List<String> projectCodes = Arrays.asList("1001","1002","1004","1005");
List<String> countries = Arrays.asList("USA","GER","UK");
}

My result by creating a permutation and combination of all list would be.
Output : (AD112,AD114)
In my real use case each list might have 1000 values in it.
And my decision table can have a million records.
How can I achieve using drools.

A:

You should have each row as a fact Article with fields store, projectCode, country, articleNumber. Your rule would be
rule select
when
  $article: Article(
      store in ("10","30","40","50"),
      projectCode in ("1001","1002","1004","1005"),
      country in ("USA","GER","UK") )
then
  System.out.println( $article.getArticleNumber );
end

