clara

http://www.clara-rules.org/
Joel 2019-05-01T01:13:28.042200Z

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.

Joel 2019-05-01T01:14:47.043200Z

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

2019-05-01T14:36:18.044600Z

@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.

2019-05-01T14:36:59.046Z

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.

2019-05-01T14:37:29.047Z

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.

2019-05-01T14:37:36.047300Z

In Clara the reverse is true.

2019-05-01T14:37:53.047800Z

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

2019-05-01T14:38:39.049200Z

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.

2019-05-01T14:39:14.050400Z

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.

2019-05-01T14:40:34.052800Z

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.