我是 Drools 的新手,负责编写规则文件,即 drl 文件。我面临一个问题。
运算符contains
用于检查集合或数组字段是否包含指定值。
Object( objList contains "bye") -- 验证 objList 中是否存在“bye”,即验证字符串。
但是,我有对象列表,并且想要检查列表是否包含任何特定对象,因此我使用上面的方法将字符串替换为对象,但这不起作用。'
有人可以帮我吗?
最佳答案
尝试 memberOf
运算符
来自流口水Rule Language Documentation
The operator memberOf is used to check whether a field is a member of a collection or array; that collection must be a variable. Blockquote
关于drools - 检查 Drools 列表中是否存在对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17051361/