Fork me on GitHub
#clara
<
2021-10-05
>
jherrlin16:10:02

Hey! Im faily new to the rule engine concept and Clara. But having a great time with it! Made a bomberman clone with all of the game logic in Clara. https://github.com/jherrlin/bomberman-with-clara/blob/master/src/se/jherrlin/claraman/claraman_rules.cljc

jherrlin16:10:33

My next quest is to use Clara on some complex business logic at work and I cant understand why some facts was inserted. How do you use to debug things like that? In Ryans talk (here: https://youtu.be/Z6oVuYmRgkk?t=1805) he shows a good looking page on the flow and how facts came to be. Is that tool publicly available?

ethanc16:10:08

Clara Tools(https://github.com/rbrush/clara-tools) still exists however it is likely a little more than out of date. I believe that the inspect namespace provides some visibility, via listeners, as to what the session was doing: https://github.com/cerner/clara-rules/blob/main/src/main/clojure/clara/tools/inspect.cljc I personally haven’t had too much time to make my own tooling around the listeners, but in theory most things should be possible. The Listeners should be provided with a wealth of information about what operations the session is going through.

jherrlin16:10:21

Thx @ethanc for pointing them out!

jherrlin16:10:13

So it would be doable to hook up for example a websocket and stream what the session is doing?

ethanc16:10:44

If you were to write a custom listener, then i would imagine that the listener would be able to send data. Though the aggregation and display of the data would probably be the more fiddly bit. Listeners themselves are pretty basic: https://github.com/cerner/clara-rules/blob/main/src/main/clojure/clara/tools/internal/inspect.cljc#L1

👍 1
jherrlin16:10:34

Okey! Thanks! Ill look into it and see what happens