drools - 如何在 Drools 规则引擎中使用 Rest Service API 调用打开实时查询
问题描述
我正在使用 RuleServicesClient 在单独托管的 KIE 服务器上执行规则。
一般来说,我使用以下代码来触发规则 -
RuleServicesClient ruleClient = kieServicesClient.getServicesClient(RuleServicesClient.class);
List<Command<?>> cmds = new ArrayList<Command<?>>();
KieCommands commands = KieServices.Factory.get().getCommands();
cmds.add(commands.newInsert(test, "test1"));
BatchExecutionCommand batchExecutionCommand = CommandFactory.newBatchExecution(cmds, "sesion_1");
ServiceResponse<ExecutionResults> response = ruleClient.executeCommandsWithResults(containerId, batchExecutionCommand);
现在我需要通过在参数中传递事件侦听器来打开实时查询,但找不到任何关于如何使用 RuleServicesClient 实现此目的的示例。
我能够执行如下简单查询,但不确定如何为实时查询执行此操作。
cmds.add(commands.newQuery("QueryResult","test_query"));
对此的任何帮助将不胜感激。
谢谢
解决方案
推荐阅读
- javascript - 无法解决:将对象数组映射到按钮元素(React)
- java - 为什么 Hibernate 将我的批量插入拆分为 3 个查询
- wordpress - 致命错误:使用命名空间时找不到类“WC_Settings_Page”
- javascript - Google Maps Directions Service,如何等待所有请求完成?
- html - 如何找到元素的完整类名?
- google-chrome - 从公共网站的超集显示 iframe 下的图表时出错,错误表示 CSRF 令牌不匹配
- h5py - 为什么读取 h5 文件非常慢?
- c++ - 在 C++ 向量中存储指针时出错
- css - CSS放大字体动画导致跳跃的div
- linux - 当我的 PC 为 ARM64 架构时,安装为 AMD64 开发的软件包