Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-2929

Note about Undeeded Patterns

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Won't Do
    • Minor
    • None
    • None
    • drools-verifier
    • None

    Description

      Restrictions are not needed in this rule.

      rule "Pattern possibility that is always true"
      when
      a: Restriction()
      b: Restriction()
      $pp: SubPattern()
      Opposites(
      (
      left == a && right memberOf $pp.items
      ) && (
      left == b && right memberOf $pp.items
      )
      )
      then
      insert( new AlwaysTrue( $pp, a, b ) );
      end

      Because it could be simply written as:
      when
      $pp: SubPattern()
      Opposites( $left: left memberOf $pp.items &&
      $right: right memberOf $pp.items )
      then
      insert( new AlwaysTrue( $pp, $left, $right ) );
      end

      Attachments

        Activity

          People

            trikkola Toni Rikkola
            trikkola Toni Rikkola
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty