Drools实现问题

发布于 2024-11-17 08:24:32 字数 365 浏览 3 评论 0原文

我正在尝试在我们的项目中实现Drools,但我真的不知道该采用哪种方法。首先,我们的项目是为移动网络运营商创建营销活动。因此,我们有一个 Web UI,让用户可以为活动定义自己的规则.. 现在.. 这是我的问题。我应该尝试使用自定义议程名称在自定义 drl 中翻译 UI 中的所有内容(因为可能有许多具有不同流程的自定义活动),还是应该创建一个具有不同属性的对象,该对象应反映网络中所选的选项-ui 然后在我的规则中使用它来创建行为?

如果我应该选择第一个选项,我该如何存储它?我是否应该将 drl 存储在 Guvnor 中(但是模型会不时更改......而不是规则中使用的属性,其他属性......并且我无法从 url 导入多个 jar 来访问模型,可以我?)或在数据库中,并在运行时动态添加规则?

I'm trying to implement Drools in our project, but I really don't know which method to adopt. First of all, our project is about creating marketing campaigns for mobile network operators. So, we've got a Web UI where we let the user define his own rules for the campaign.. Now.. here's my problem. Should i try to translate everything in the UI in a custom drl with a custom agenda-name (because there can be many custum campaigns with different flows), or should I create an object with different properties which should reflect the chosen options in the web-ui and then use it in my rules to create the behaviour?

If I should go with the first option, how can I store it? Should I store the drl in Guvnor(but the models my change from time to time.. not the attributes used in the rules, other attributes.. and I can't import several jars from an url to have access to the models, can I?) or in DB, and the dynamically add the rules at run-time?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

知足的幸福 2024-11-24 08:24:32

这两个选项都有效。我的第一直觉是创建一个反映 UI 中选择的对象模型。然后,您可以将此对象添加到知识库并基于它触发您的规则。

如果您选择第一个选项,您可以将规则存储在 Guvnor 中,或者也可以将规则存储在数据库中并在运行时从流中导入规则。我目前正在开发一个大型企业项目,该项目通过 guvnor 进行了令人垂涎的更改,并且模型经常更改。我们在将新模型上传到 guvnor 时没有遇到任何问题。

Both of the options will work. My first intuition would be to create an object model that reflects the choices in your UI. You can then add this object to the knowledgebase and trigger your rules based on it.

If you do go with the first option you can store the rules in Guvnor or you could also store the rules in a database and import the rules from a stream at runtime. I'm currently working on a large enterprise project that incorporates drools changes via guvnor and the models change quite regularly. We have not had any issues uploading new models into guvnor.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文