drools - Drools - 通过 KIE 服务器 REST 执行规则没有给出响应
问题描述
我正在尝试通过 KIE 执行服务器 (kie-server-7.17.0.Final-ee7.war) 执行使用 Drools Workbench (business-central-7.17.0.Final-wildfly14.war) 编写的规则,我当我使用 Postman、REST 客户端执行规则时,没有得到预期的响应。
我试过设置请求头“ X-KIE-ContentType XSTREAM
”,设置有效负载标签<insert out-identifier="Employee" return-object="true" entry-point="DEFAULT">
在哪里out-identifier="Employee"
。
请求有效载荷
<batch-execution lookup="TestBaseSession">
<insert out-identifier="Employee" return-object="true" entry-point="DEFAULT">
<com.test.Employee>
<iEmpId>27</iEmpId>
<strName></strName>
</com.test.Employee>
</insert>
<fire-all-rules/>
</batch-execution>
规则文件
package com.test;
import com.test.Employee;
//This is the first rule
rule "001"
when
emp : Employee(iEmpId==27)
then
emp.setStrName("FooBar");
insert(emp);
//System.out.println("DDDDD");
end
我希望输出如下所示(或类似),
<response type="SUCCESS" msg="Container Test_1.0.0 successfully called.">
<result class="execution-results">
<result identifier="Employee">
<com.test.Employee>
<iEmpId>27</iEmpId>
<strName>FooBar</strName>
</com.test.Employee>
</result>
<fact-handle identifier="Employee" external-form="0:1:850421248:850421248:1:DEFAULT:NON_TRAIT:com.test.Employee"/>
</result>
</response>
但是我没有得到预期的结果,Wildfly 控制台中也没有打印 System.out 消息,这表明该规则没有执行?任何建议都会非常有帮助。
解决方案
推荐阅读
- python - 如何打印 sqlite3 数据库的内容?
- java - 带参数的 Java 方法的类图
- c# - 如何通过 DbContext 过滤批量寄存器 IEntityTypeConfiguration<>
- firebase - 为什么登录不会使用firebase和flutter自动转到仪表板
- javascript - 如何使用 HTML、css 和 Js 在侧边栏中显示子菜单
- javascript - Adobe PDF 对话框脚本
- r - 使用 Jupyter Notebook 运行 R 代码时内核不会启动
- google-sheets - 添加一个函数以根据 URL 显示图像,该 URL 会根据表格中的单元格而变化
- reactjs - 如何将 Mock Service Worker 与 AWS App Sync GraphQL 查询结合使用?
- python - 如何在 Python 中淡化图像