-
Notifications
You must be signed in to change notification settings - Fork 493
can not remove rule #120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@hehejiuhuizhe This is correct - if the engine is If the values were reversed and the rule was removed after 1 second and the engine run at 3 seconds, in that case seeing the event fired would be unexpected. Does that make sense? Or am I misunderstanding and you're making a different point? |
I mean the event would be fired when I use engine.run().But I have removed the rule so that there is no rule in the engine. |
@hehejiuhuizhe I think you may be missing the concept behind t=0: Engine is created and rule added |
@CacheControl |
I checked the scenario @hehejiuhuizhe seems rigth. I came across with same result. when I debugged the code I realize run method calls json-rules-engine/src/engine.js Line 146 in 5ac00ea
json-rules-engine/src/engine.js Line 64 in 5ac00ea
Simply little cache mechanizm brokes it. The list has to be recreated after removeRule method called or force to create new one in prioritizeRules method. |
@ozanerturk thanks for checking into this, and the offer to implement a fix. I agree with your assessment. I think a good fix would be to add a line for setting the json-rules-engine/src/engine.js Line 56 in 5ac00ea
|
Hello,I'm looking for a rule engine written in js,and I find this project easy to use,and following is my problem using the engine.
I add a rule,then run the engine per 1 second.
After 3 seconds,I remove the rule.
However,I still got "hello-world!" per second.
I think there need to be a remove rule test.
I have a look at the source code,the problem can be solved by adding this.prioritizedRules = null to removeRule.
Here is my code
The text was updated successfully, but these errors were encountered: