1
votes

I'm trying to find a way to inherit rules using drools, or to load a .drl file from another .drl file (which doesn't seem possible from my recent searches).

As an overview, we have multiple clients, and each client has one or more projects. The clients have a large of set of client-specific rules, and each project may or may not have a small set of client specific rules. To avoid reusing code, I'd like to have separate rules files for clients and their project, and then have the project rules be able to inherit or call the client rules. Is there any way to do this?

Without getting too deep into our code, I'm trying to find a way to do this without modifying java, as this code already affects multiple clients and it is somewhat automated. I know that we can add another section of code to call another rules file, but I'm hoping to find a way around that. Any suggestions?

1

1 Answers

0
votes

You can take a look at Drools Flow

It is possible to define ruleflow groups for each of your clients / projects and specify their activation constraint in flow definitions.

Your flow, oversimplified, might look like this sample flow

You need to define the flow / bpmn2 file during KnowledgeBase creation, so a little code editing seems to be inevitable.