Adding Else action #329
Replies: 1 comment
-
@SluggyYarvin while it's easy to try and extrapolate an "else" action from imperative rules, it's quite challenging to implement in production rules engines, and generally doesn't quite make sense. Intuitively, I would assume "else" applies when "then" doesn't. But I don't know if that logically makes sense. For example, consider a very simple rule (in pseudo code):
In a production rules engine a match means that there is a fact (or a set of facts) that satisfies all conditions. In this case that there is a customer whose status is "Golden". But if there is no match (presumably the "else" clause) that does not mean that there is a customer whose status is not "Golden" - it's possible that there is no customer fact at all, in which case, this else condition is pretty useless. This only gets worse as the rules become more complex. As such, it's very unlikely this feature will get implemented. Though I'm curious to see what your experience with the "else" clause was in the WF rules engine. What was the behavior there and what were the general case expectations? |
Beta Was this translation helpful? Give feedback.
-
I am migrating from the WindowsWorkflow Foundation Rules engine. In that rules engine, the rules could have a then and an else action. Having an Else action for NRules rules, would allow me to migrate the rules directly, logic wise. Since the Else does not exist in NRules, I now need to create two rules for every rule that I am migrating that has an Else action. This would be an optional action, but it could be really useful in certain situations.
Beta Was this translation helpful? Give feedback.
All reactions