Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-3853

Ability to override existing rules in one KIA base with rules from another KIE base

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • core engine
    • None
    • NEW
    • NEW

    Description

      I would be nice to have ability to override a rule defined in one KIE base with a rule defined in another KIE base. In Drools 5 it was possible to misuse a bug which didn't check for identical rules named to override them by using the same rule name with an appropriate drl file load order.

      This has already been brought up here but I think an actual feature
      request was never created https://groups.google.com/forum/#!searchin/drools-usage/overriding%7Csort:date/drools-usage/mvpBoVFZblk/FX-vkYxHBQAJ

      Use case
      Need to build a layered set of rules where extending layers may need to
      override existing rules in the lower layers. I want to avoid rule duplication
      (majority of rules would have to be duplicated) so prefer the layers.

      Usage
      Annotate a rule with @Override.

      Workaround
      Beyond the obvious rule packaging change to copy all rules instead of building layers I think it would be possible to do following:

      To override a conflicting rule the resulting facts must be inserted logically
      and rules annotated as @Defeasible. An overriding rule must have @Defeats("base rule").

      This approach might not work for all scenarios.

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            vaclavcarnogursky Vaclav Carnogursky (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: