noolsjs / nools

Rete based rules engine written in javascript
http://noolsjs.com/
MIT License
951 stars 181 forks source link

matching rules fire only once #126

Open hjank opened 10 years ago

hjank commented 10 years ago

Hi, in our project, we are calling match() via setInterval() on a session with initially asserted facts. We want to avoid using matchUntilHalt(), yet this way we observe that our rules fire only the first time match() is called - unless we reassert all facts during each iteration, which is no option either. Any ideas as to what might be the cause and solution to our problem are most welcome. Thanks in advance!

shacal commented 10 years ago

Use modify() to all your facts before calling match() again. Multiple calls to match, does not reset your facts, unless you create new session before match().