rules-framework icon indicating copy to clipboard operation
rules-framework copied to clipboard

Describe rules match/search execution plan

Open luispfgarces opened this issue 3 years ago • 0 comments

Purpose

Explain a rule match/search execution plan, as a way for users to troubleshoot defined rules.

Main functionalities

  • Describe match one rule execution plan
  • Describe match many rules execution plan
  • Describe search rules execution plan
  • Format execution plan as a text string

Proposal

Create new a entity on Rules.Framework named ExecutionPlan, including information:

  • Input - content type, match date/match interval, conditions
  • Evaluation options - match mode and if rules without search conditions are excluded
  • Rules loaded from rules data source
  • For each rule evaluated, on each condition node evaluated on tree:
    • Original condition node
    • Left hand operator value (and if it comes from input conditions or from default value)
    • Condition node w/ left hand operator replaced
    • Condition node evaluation result: True / False
    • Rule included/not included on matched rules
  • Matched rules
  • Rule selected by priority (when on match one scenario)

Have new methods with similar functionality as match one, match many and search:

  • DescribeMatchOneAsync(...)
  • DescribeMatchManyAsync(...)
  • DescribeSearchAsync(...)

The best design would be to probably have original methods with this functionality added, but would probably mean a breaking change, so we either proceed with this approach and re-design the Rules Engine API on next semantic major version (where we could do a breaking change), or we can do it right away and move immediately to next semantic major version - open for debate.

NOTE: to add actual implementation plan later here.

luispfgarces avatar Nov 24 '21 23:11 luispfgarces