使用时出现问题!以及drools字符串操作(例如match,str [startsWith])。 知道为什么流口水不允许!使用运算符,例如match,not match,str [startsWith],str [endsWith],长度
!适用于==,<,>。
等其他运算符package example
import com.Customer
rule "sample rule"
no-loop true
dialect "mvel"
when
$customer:Customer!(state == "CA" && city str[startsWith] "TOP")
then
System.out.println("Do something" );
end
错误消息: [ERR 102]第11:19行的输入“!”不匹配在规则“样本规则”中的规则]
package example
import com.Customer
rule "sample rule"
no-loop true
dialect "mvel"
when
$customer:Customer!(state != "CA" && city != "TOP")
then
System.out.println("Do something" );
end
Drools应该能够验证以下drl,而不会出现任何问题, 包示例
import com.Customer
rule "sample rule"
no-loop true
dialect "mvel"
when
$customer:Customer!(state == "CA" && city str[startsWith] "TOP")
then
System.out.println("Do something" );
end