Fork me on GitHub
#clara
<
2019-05-01
>
joel38001:05:28

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.

joel38001:05:47

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

mikerod14:05:18

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

mikerod14:05:59

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.

mikerod14:05:29

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.

mikerod14:05:36

In Clara the reverse is true.

mikerod14:05:53

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

mikerod14:05:39

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.

mikerod14:05:14

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.

mikerod14:05:34

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.