0
votes

I have a scenario wherein I need to add rules to a rule engine dynamically. What if I add same rule twice/multiple times? I am not able to get exact behavior of Drools by doing POC(I am a newbie to Drools). Also, if a rule once inserted remain in knowledgeBase until I explicitly remove it?

1
You should really include a more descriptive question title.Chris Tavares
Why should a rule disappear from the Knowledge Base? Software is soft, but it doesn't evaporate.laune

1 Answers

0
votes

You cannot add the save rule twice (which is sufficient to rule out "multiple times"). If it is the "same", it simply replaces the previous "same" rule. If only the titles differ, then (it isn't the same rule and) you have two rules with the same LHS and the same RHS. This may, or may not, produces the same reaction a second time: this depends on what the RHS does or does not.

You can and should clarify these things by reading the documentation and/or experimenting with a simple setup.