在dslr中,您可以将值列表传递给条件,还是将Drools限制为一个值?
我想写一些像:
[condition][]The customer firstName is in this list {nameList}=...
而不是
[condition][]The customer firstName is {name1} or {name2} or {name3}=...
答案 0 :(得分:3)
适合的DRL结构是使用“in”的复合限制,写成例如。
Person( name in ("Joe", "Tom", "Fred") )
在您的情况下,DSLR定义应该是
[condition][]The customer firstName is in this list {nameList}=
Customer( firstName in ({nameList}) )
请注意,在DSL中,您必须使用引号编写名称:
The customer firstName is in this list "Joe","Tom","Fred"