Fork me on GitHub
#clara
<
2017-01-31
>
apbleonard19:01:32

Looking for options for debugging rules. Would have saved some time discovering typos etc today if I could have switched on debug logging evaluating every condition of a given rule say. Or even had "explain-non-activations". Any tips?

apbleonard21:01:49

Ok. So it looks like inspect would have helped me. Will also try tracing tomorrow...

wparker21:01:44

Inspect might be more helpful if you’re looking at ordinary sorts of errors like a bad rule etc. Tracing can be useful too but definitely gets into implementation details

wparker21:01:35

If it concerns exceptions running against the branch that is out and in progress for https://github.com/cerner/clara-rules/issues/255 could be helpful too

apbleonard23:01:35

Thanks :) Was more about straightforward debugging. Just getting started with Clara!

apbleonard23:01:26

Also - looking at source of load-rules in clara/rules.cljc you can just supply a list of symbols resolving to individual rules, not just namespaces - is that correct? Would love an example of this. Flexibility around how rules are assembled would be great.

wparker23:01:08

I think a call to mk-session like the one at https://github.com/cerner/clara-examples/blob/master/src/main/clojure/clara/examples/fact_type_options.clj#L20 is what you’re talking about, ignoring the :fact-type-fn and :ancestors-fn options