Oracle-Drools 集成可能吗?
我有一些 Drools 文件。 我希望这些 Drools 文件对 Oracle 数据库中的某些记录起作用,然后它们的结果必须更新或插入某些记录。
这可能吗?
I have some Drools files.
I would like these Drools files to act on certain records in the Oracle database and then their outcome must update or insert certain records.
Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Drools是反动工具。在插入对象时,drools 会创建一个 rete 树,以便在触发规则时触发 THEN 条件。因此,您必须断言工作内存中的对象才能触发规则。
Drools is reactionary tool. While inserting the objects, drools creates a rete tree to fire the THEN condition at the time of firing the rules. Hence, You will have to assert the objects in working memory to fire the rules.
您需要在运行规则之前从数据库加载记录并将其插入到知识库中,或者您可以使用“from”关键字在规则执行期间获取记录。
以下是如何使用“from”和 Hibernate 从数据库获取记录的示例:
更新和插入记录可以在 Drools 规则的条件部分中完成。这部分规则可以用与任何 Java 程序相同的方式编写。
有关“来自”的更多信息,请检查以下内容:
Drools 文档
Jaroslaw Kijanowski 的博客
流口水& jBPM 博客
You need to either load the records from the database and insert them into the knowledge base before you run the rules or you can use the "from" keyword to get the records during rule execution time.
Here is an example how you can get the records from the database using "from" and Hibernate:
Updating and inserting the records can be done in the condition section of the Drools rule. This part of the rule can be written in the same way as any Java program.
For more information about "from" check the following:
Drools documentation
Jaroslaw Kijanowski's blog
Drools & jBPM blog