Retaking rules for developers
Simple
Clara offers a simpler way to express domain knowledge in code, without the weight of an enterprise rule system.
Expressive
Simple rules stay simple, but users can write rich logic or invoke external libraries when they need to.
It's just Clojure
Rules are just Clojure code, and can be managed and reused like anything else.
(defrule work-approval
"Check order approval."
[WorkOrder (= type :repair)
(= ?order-id order-id)]
[:not [ApprovalForm (= ?order-id approved-id)
(= formname "27B-6")]]
=>
(insert! (->MissingApproval ?id "No 27B-6.")))
Easily used from Java
Just include your rules as a resource and use Java Beans or Clojure records as facts.
List<QueryResult> results =
RuleLoader.loadRules("clara.examples")
.insert(facts)
.fireRules()
.query("clara.examples/approvals");
for (QueryResult result: results)
System.out.println(result.getResult("?id"));
Drawn from multiple worlds
Clara aims to combine the best ideas from expert systems, functional programming, and the best known develpment practices.
And many other features...
Clara supports the features you'd expect from a rule engine, such as support for truth maintenance, durability, rule activation explanations, accumulators to reason across sets of facts, and others.