-
Notifications
You must be signed in to change notification settings - Fork 449
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
Feature request - Decision Tables #37
Comments
@arsalans interesting concept. My understanding of decision trees is that for each permutation of the conditions, there is a defined set of actions. Although it would be easy for the engine to take in a list of conditions and compute a rule per permutation, I'm confused as to how the engine would know the appropriate event to fire in each circumstance. Maybe I just need you to expand on the use case you provided so I can understand the problem you're trying to solve. |
@CacheControl So, how about if I write my rule like this, and again, I am trying to be as naive as possible:
new DecisionTable (decisionTable, helper); So now, the DecisionTable object knows what are the conditions and what are the events to send. |
@arsalans Ah ok, I think I get it now. In json-rules-engine vernacular it's essentially wanting to vary the event based on which condition succeeded. To me, this almost feels like an accessory package that would act as a rule generator - it would take in the decision tree data structure you posted above, and use it to generate a rule per decisionTable row. json-rules-engine would be responsible for the lower-level execution of the generated rules. Alternatively, you may want to look at the ruleResult feature just released in 2.0.0 - you can use the It terms of whether or not this belongs in json-rules-engine itself, right now it feels like something I'd like to keep separate; I want to keep json-rules-engine as the low level executor of basic boolean logic + firing events, while more complex rule orchestrations such as decisionTables are probably better suited as plugins/extensions. |
Here's the ruleResult docs I mentioned above. |
@CacheControl I was wondering if this rule engine can support decision tables.
What do I mean by that:
So a decision table is composed of many rules that differ usually by one or more conditions. So, for example, I will create a decision table to implement this logic:
So, you will read it like this, if a color is "Blue" then the price is $10. So instead of creating 7 separate rules, I will only create one rule, a decision table rule. Let me know what do you think.
The text was updated successfully, but these errors were encountered: