Live rule creation in Drools Planner

試著忘記壹切 提交于 2019-12-24 14:37:05

问题


I am interested in creating rules for Drools Planner. I want that a user can create his own rules in a java app before starting the Drools Planner. Maybe a Drools-rule-file could be generated after the user has added his rules. Would this be possible or do I have to create the rule-file while developing the whole java application?

Many thanks...


回答1:


Yes it's possible. The trick is to build your own RuleBase and set it in the Planner config. See section "5.3.4.2.2. A RuleBase (possibly defined by Guvnor)" in the manual.

You can construct a RuleBase by several, depending on how you want your user to edit his/her rules:

  • From a DRL file. This presumes the user knows DRL. See Drools Expert manual.
  • From a DSL file. This allows you to use natural language.
  • From the guvnor webapp. This allows you to use the tooling Guvnor, such as a guided rule editor, a decision tables spreadsheet, ... You can even use a changeset.
  • From guvnor in eclipse or a standalone app (under development and experimental). There's some work being in this area, but it's still young.


来源:https://stackoverflow.com/questions/11017613/live-rule-creation-in-drools-planner

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!