Fork me on GitHub
#clara
<
2020-10-06
>
futuro15:10:56

A second idea @bmaddy , if it fits your project, would be to create a UI for building rules, perhaps presenting a searchable list of Fact records to users, along with their available fields, and allow them to pick the facts and fields they want to match on, plus the Boolean expression combinations.

futuro15:10:43

That’s definitely not a small project, but might greatly raise the accessibility for non-developers to write facts with, while providing guardrails to help them.

👍 3
bmaddy15:10:05

@futuro Yeah, a UI would be nice, but that's way off in the future. At the moment, we're not entirely sure we'll have users writing actual rules yet. We'll see what happens. Good ideas though!

👍 6
3
Matthew Pettis20:10:45

I think I've asked this before, but I cannot retrieve the history too far back of this channel... What is the best way to capture the chain of facts and rules that caused a fact to be produced in a session? I don't need a full-blown GUI, and honestly would just be able to get a data structure I can manipulate myself...

Matthew Pettis20:10:20

So, for instance, if I have a session with a rule that has something like "P => Q" and I insert a fact P into the session, and query for the fact Q, which should be present, I'd like to be able to take Q and inspect the session and see the presence of fact P and the rule "P => Q". But, you know, with more complex rules and such. Is this readily available?

Matthew Pettis20:10:39

I've looked at https://github.com/rbrush/clara-tools , but I can't get the shopping.clj example to work -- launches a web page, but with no session and nothing to look at, as far as I can tell. But again, I really don't want the gui, I just want to be able to inspect a session for the chain of facts and rules that lead to other facts being present in the system...

Matthew Pettis20:10:39

It should also make sense in simple cases. As in the prior case, if P is an inserted fact, and I want to see how I got P, I should just see "P" with no rules, as it was inserted a priori...

wparker19:10:40

As far as I know the clara-tools project isn’t really maintained anymore. From what you describe though I think you can probably accomplish what you’re looking for in a non-GUI environment with session inspection, particularly the :fact->explanations key. http://www.clara-rules.org/docs/inspection/

👍 3
wparker19:10:43

The fact-graph functionality might also be of use, though note that this is basically just another view over the information returned by session inspection. https://github.com/cerner/clara-rules/blob/main/src/main/clojure/clara/tools/fact_graph.cljc

Matthew Pettis19:10:09

Thanks! I think session-inspection is exactly what I need at this point of what I think are my simple needs.