1

How can I do to add new dynamic facts to working memory? for Example: If I have a rule like this:

(deftemplate person(slot idPerson)(slot age)(slot like))

(defrule sports
"Give a discount on sport items"
(person {age >18 && age<30}{like soccer}{idPerson ?idPerson})
=>
(add (new offer"10% of discount on sport items to" ?idPerson)))

And.. If Jess is running until there are rule to fire.(run-until-halt)

How can I do to add new facts to Jess working memory from another application or script when a event happend out of Jess?

Wilisumo
  • 33
  • 4
  • If you run Jess from a Java application by calling the Rete method runUntilHalt in one thread, you can use Rete methods add and addAll to insert new facts from another thread. – laune Mar 23 '15 at 15:17

0 Answers0