Fork me on GitHub

I appreciate all the help here so far! FWIW, I'm looking into something that might work better than Drools for us. On that side we currently leverage rule-groups, and the order of groups is controlled. I think we can probably break away from that pattern, but just in case, the reason for my question is to see if that behavior could be had as a "fallback" in Clara. I think though if facts get "kicked out" of WM, then managing that could be kind of ugly. It sounds like the "one true way" in Clara is to put guards in as appropriate, and that's the approach I'll take for now rather than trying skip rule-groups or some such by segregating the rules.


I'm curious if anyone changes their rules dynamically in a production environment, and any issues that may come up as a result.


@joel380 Clara does have support for activation group like behavior. But it doesn’t completely disable rules. It prioritizes a firing order. It’s much like salience, but on a group of rule level. And salience works within a group.


I just tend to think you can write more robust rules when you don’t write them in order dependent ways. Clara defaults to logical inserts that self-maintain the logical consistency to eliminate a large need for ordering.


Drools provides a truth maintenance system too, but it isn’t the default in drools to insert “logical”, you have to call a separate fn for that in Drools.


In Clara the reverse is true.


Part 2: what do you mean changing rules dynamically in production?


You’d have to create a new session+rulebase for new rules. Clara doesn’t support dynamic addition and removal of rules in an already constructed network.


Drools does. And the semantics are to distribute working memory state to the new rules as they are added I believe. Clara has some mice optimization properties due to it not allowing this.


It’s possible it could be a future “mode” supported, but that’s require someone quite motivated to do it. I tend to think you can often just make a new session and re-run from scratch, or only put new rules in separate session and propagate facts from one to the next as needed. Cases vary though.