2
votes

Scenario- 1. End user should be able to create rules from a front end. The rule would have conditions (I could not figure out a way in Drools to dynamically modify the .drl file on the basis of rules created by users)

  1. Rules should be able to be defined in a hierarchy and the same rule can belong to multiple hierarchies

  2. The end user should be able to trigger the execution of the rules. The caveat here is that the facts might not be available in the KnowledgeSession, the rules get converted to relevant queries as per the underlying database and then they get triggered on the underlying DB.

So the idea is Rules get created with limited knowledge of the entities -> When rule is triggered it works with the underlying db to create queries relevant to the entities present in the underlying db

Would I be able to do something with Drools, another rules engine instead of building a custom implementation?

1

1 Answers

1
votes

It looks like what you're going to do is not easy. But drools should be a way to make it easier. I'll assume that by "hierarchy" you mean rule flows, and not rule-flow groups, but I think the answer applies anyway for the other scenario.

I think the tool you might want to check is Drools Guvnor, as it stores rules in the DB and provides a UI to change them.

I think the tricky bit will be to apply those rules in different rule flows, but I'm sure that drools provides a way to do it. Or the worst case scenario is that you'll need to clone the rules and put them in the different rule-flow groups.