我是 Drools 的新手,并试图了解这一切......
我在 Workbench 6.3.0.Final 中创建了一条规则:
package demo.dummyapp;
import java.lang.Boolean;
rule "RuleThree"
dialect "mvel"
when
SMS(sendMessage == true )
then
System.out.println( "This message is being sent" );
end
并从 Postman 我使用 REST API 调用以下内容:
POST: http://myserver/kie-server-6.3.0.Final-ee7/services/rest/server/containers/instances/dummyapp
{
"lookup": "ksession1",
"commands": [{
"insert": {
"return-object": true,
"object": {
"demo.dummpyapp.SMS": {
"sendMessage": true
}
}
}
}, {
"fire-all-rules": "RuleThree"
}]
}
从服务器返回的响应是成功的:
{
"type": "SUCCESS",
"msg": "Container dummyapp successfully called.",
"result": "{\n \"results\" : [ {\n \"key\" : \"RuleThree\",\n \"value\" : 0\n } ],\n \"facts\" : [ ]\n}"
}
但是我在 server.log 中没有看到我的 println 消息...所以我怀疑该规则是否按预期触发?任何建议我将不胜感激。