Replies: 1 comment 3 replies
-
HI @newm4n, can we use orderedmaps instead of following the proposed approach I found a good one online - https://github.com/elliotchance/orderedmap. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
From
RuleEngine_en.md
,Because Go's map types are not guaranteed to preserve input order, it is not safe to assume that rule evaluation order will match the order in which Rules are added to a Grule knowledge instance.
I just thinking, when user insert the rule with no salience specified. We could apply the salience not to the default of 0, but we can insert them with the smallest known salience -1.
The thing is, if a user wants a specific rule (for example rule "AClosingRule", to be called for the last time, he can only insert that rule as the last rule to insert. Other wise, the next inserted rule with no salience will be even lower to that "AClosingRule" rule.
This approach may be also valid for engine with rule set generated from database. where select statement return an ordered rule set to be feed to Builder every-time the
KnowledgeLibrary
is created a new.I fear this may cause un-necessary confusion or complexity. Or just leave it at it is let the user manually set their own salience so it be more clear to them.
Beta Was this translation helpful? Give feedback.
All reactions