clara

http://www.clara-rules.org/
Eduardo Mata 2020-01-06T19:55:29.034500Z

I am applying a basic rule saying

(defrule missing-information
[?event <- Event (nil? flower-id) (= ?id _id)]
=>
(insert! ->AddError _id  :error "Missing Flower _id"))

Eduardo Mata 2020-01-06T19:56:10.035400Z

for some reason, I have a Record with flower-id and it clara still telling me the flower-id is missing

2020-01-06T20:18:24.038500Z

@contact904 do you have more than one Event? Are you saying an Event with a non-nil flower-id and a unique _id is being matched with the above rule which insets the AddError fact? Your ->AddError syntax seems incorrect since it isn’t calling the fn to but guessing that this is maybe pseudo-code

Eduardo Mata 2020-01-06T20:21:35.039500Z

AddError is a new Record with fields _id, error, value it is close to a pseudo-code

Eduardo Mata 2020-01-06T20:22:04.040Z

I am confused because I have been usings this rule for a long time, this is the first time I get this error

Eduardo Mata 2020-01-06T20:25:56.040400Z

I see what is my problem. I have similar _id;s

2020-01-06T20:34:59.041Z

@contact904 (insert! ->AddError _id :error "Missing Flower _id") is missing parens was my comment on syntax (insert! (->AddError _id :error "Missing Flower _id"))