i have set of rules each of user. right now, these rules setup in file. want allow users modify / add rules. rules aren't complicated. instance, below couple of rules:
rule "rule 1" when $order : orderinfo(getorderdate() < new date(...) $order.setreturneligibility(false); end rule "rule 2" when $item : iteminfo( nonreturnablecategory.contains(getitemcategory().tolowercase()) ) $item.setreturneligibility(false); end rule "rule 3" when $item : iteminfo( isfinalsale()) $item.setreturnmethod(...); end
i want build ui similar drools workbench. end customer, want simple, user-friendly ui. , planning store rules in database.
i want allow users add new rules , modify existing ones. instance, if rule 3 above not available, user have dropdown in ui, can select item categories not returnable. or can enable or disable of rules etc.
what wanted know is, best way maintain rules? should have entire rules file string in db sort of place holders, , modify string , when user adds / updates rules? i'm using drools 6.2. know question kind of vague, have no idea how / begin, suggestion appreciated.
thanks.
if modifying existing rule means constraint changes "text place holder" might idea.
however, not store entire drl file db entry. system individual rules stored entities work best. attributes name, text, "is selected" attribute etc.