带not条件的Drools规则,多个条件导致错误
当我在“not”中使用下面的条件时,我得到了一个错误带not条件的Drools规则,多个条件导致错误,drools,rule-engine,Drools,Rule Engine,当我在“not”中使用下面的条件时,我得到了一个错误 not(Obj1(value == 0) && Obj2(value <= 3)) 规则如下所示: rule "test_6" salience 10 when not(Obj1(value == 0) && Obj2(value <= 3)) then ..... end &&和|运算符只能在单个模式中使用。例如:O
not(Obj1(value == 0) && Obj2(value <= 3))
规则如下所示:
rule "test_6"
salience 10
when
not(Obj1(value == 0) && Obj2(value <= 3))
then
.....
end
&&
和|
运算符只能在单个模式中使用。例如:Obj1(值>3&&value<10 | |值==0)
。根据,要分离模式,必须使用和
和或
运算符
因此,在您的情况下,您的规则应该是:
rule "test_6"
salience 10
when
not(Obj1(value == 0) and Obj2(value <= 3))
then
.....
end
规则“测试6”
显著性10
什么时候
非(Obj1(值==0)和Obj2(值
throwing error Error Message: org.drools.core.rule.GroupElement cannot be cast to org.drools.core.rule.Pattern
rule "test_6"
salience 10
when
not(Obj1(value == 0) and Obj2(value <= 3))
then
.....
end