clara

http://www.clara-rules.org/
henrik 2018-08-10T06:30:15.000016Z

I’m working on an ingestion pipeline for scholarly material. It takes XML files and adds them to a (Datomic) database. There’s a ton of little decisions to be made along the way. Depending on the publisher, the type of material, the presence of related material already in the database, the subject matter, the presence or absence of a myriad of little attributes in the file itself, and so on, the ingestion process behaves differently. This means tons and tons of conditionals all over the place, and it quickly gets hard to get an overview. I’ve been contemplating ways to extract this decision making process into its own place. Would Clara be a suitable tool for this?

2018-08-10T10:21:00.000246Z

@henrik that sounds like a plausible use-case. Much depends on how much involved the logic is - IMO a rules engine has some upfront cost to bring in especially if the team hasn’t used one before, but at a certain complexity of business logic it helps a lot. Clara does what it can to help by “playing nicely” with the rest of the Clojure ecosystem e.g. by being simple Clojure code rather than an entirely separate framework with its own IDEs etc., but it still is a different way of thinking and is a nontrivial component to introduce to a system. FWIW the analysis in the ThoughtWorks radar linked above seems on-target to me. My guess would be that something like you describe would work best with a rules engine if large chunks of logic can be computed before needing to return to the stateful pipeline, but as always it is hard to say since so often it is the details that are most important.

devn 2018-08-10T17:50:02.000302Z

howdy folks

devn 2018-08-10T17:50:07.000322Z

im interested in partial condition matches

devn 2018-08-10T17:50:34.000063Z

i want to answer the question: what conditions didn't match for a given rule

devn 2018-08-10T17:51:12.000234Z

i'm not sure this is possible at the moment

2018-08-10T19:30:22.000026Z

Could you give a concrete example @devn? I'm not sure what exactly you mean; session inspection has some things that might help.

devn 2018-08-10T20:09:36.000142Z

@wparker I'm looking to answer questions of "what LHS conditions for which rules weren't satisfiable?" My understanding may be incorrect, but I seem to recall the condition matches from session inspection not including information on when a rule's conditions were partially satisfied.

devn 2018-08-10T20:10:23.000289Z

truth: I keep avoiding working out a tracing listener setup that will give me the Real Ultimate Power™ I desire

devn 2018-08-10T20:12:11.000161Z

@alex-dixon I am reminded of a previous conversation that was had here about making something akin to precept-devtools work with clara. However, I am failing to remember details. Which parts of precept-devtools would not be possible without modification to clara?

alex-dixon 2018-08-10T20:44:05.000330Z

@devn Pretty much all of it would need redone since it’s so Precept specific…

alex-dixon 2018-08-10T20:45:11.000136Z

Clara’s listeners API is what you’re looking for though. You should be able to see every operation the rule engine does

alex-dixon 2018-08-10T20:45:54.000002Z

I’ve only ever used the terminal node ones but they have everything…alpha activate, alpha retract…stuff I can’t remember

alex-dixon 2018-08-10T20:46:14.000333Z

If you’re interested in CR or rule engines whatsoever it’ll pay off I promise 🙂