What is the logic by which class members from fact types are used to create local variables for the constraints?
In clara.examples.java.shopping
, there are some examples [Customer (= true VIP)]
and [Order (> total 200)]
. I assume VIP
is mapped to the isVIP()
method and total
is mapped to the getTotal()
method?
Are the rules around this defined anywhere, or could someone point me to the relevant DSL code?
@cfleming https://github.com/cerner/clara-rules/blob/941b776221690edab4904e3728715d0680bd6121/src/main/clojure/clara/rules/compiler.clj#L308
@alex-dixon Isn’t that dealing with unification vars?
Oh, it looks like field-name->accessors-used
, right?
https://github.com/cerner/clara-rules/blob/master/src/main/clojure/clara/rules/compiler.clj#L149
@cfleming Er. get-fields a few down from there what you’re looking for?
Yes, I think so - thanks!