Skip to content

rbrush/clara-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clara-tools

Experimental tooling for exploring and working with Clara-based rulesets.

See the clara-rules project for details on Clara.

Usage

Users may explore the contents of Clara sessions with the clara.tools.watch namespace. Rather than using clara.rules/mk-session, users can create an instrumented "watched" session with clara.tools.watch/mk-wached-session, which accepts the same arguments. Here is an example in use:

(require '[clara.tools.watch :as w])

;; Create a watched session and insert some facts.
(def my-session (-> (w/mk-watched-session "My Watched Session."
                                           'clara.tools.examples.shopping 
                                           :cache false)
                    (insert (->Customer :vip)
                            (->Order 2013 :august 20)
                            (->Purchase 20 :gizmo)
                            (->Purchase 120 :widget)
                            (->Purchase 90 :widget))
                    (fire-rules)))

;; Look at it in the browser!                    
(w/browse!)
                    

This will open a web browser, allowing the user to run queries, list facts, and view a rendering of the logic used.

Known Issues

This is an experimental project and is not ready for production use. The core functionality is working, with one significant exception: viewing the content of multiple sessions in a single web application may yield inconsistent results.

License

Distributed under the Eclipse Public License, the same as Clojure.

About

Experimental tools for working with Clara

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •