Sitelet https://github.com/Farfetch/rules-framework/issues/46
Skip to content

Describe rules match/search execution plan #46

Description

@luispfgarces

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions