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

Problem when mixing alpha and beta constraints in a composite constraint

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.0.4
    • Fix Version/s: 4.0.5, 5.0.0.M1
    • Component/s: None
    • Labels:
      None

      Description

      REPORTED BY Jai Vasanth

      The first case
      rule "Remove smaller or non-overriden"
      dialect "java"
      when
      L : Response( $r : value && status != "override" )
      (Response( value > $r ) or Response( status == "override"))
      then
      retract( L );
      end

      breaks down to

      rule "Rule1"
      dialect "java"
      when
      L : Response( $r : value && status != "override" )
      Response( value > $r )
      then
      retract( L );
      end

      and

      rule "Rule2"
      dialect "java"
      when
      L : Response( $r : value && status != "override" )
      Response( status == "override")
      then
      retract( L );
      end

      I see that the first rule removes all objects with smaller values and the second one removes all the ones that arent overridden if there exists an object that has an override

      What I dont understand is, why the second one doesnt have similar behaviour

      rule "Remove smaller or non-overriden"
      dialect "java"
      when
      L : Response( $r : value && status != "override" )
      Response( value > $r || status == "override" )
      then
      retract( L );
      end

      When this rule runs , it should start removing objects with smaller values that are not overridden . So if an overridden object exists finally we will be left with 2 objects

      Response( maxvalue, non override status ) and Response( somevalue, "override" )

      When the rule fires now L will take on the first one and the the other object will match the second one since it has an override even though value <= $r . This L should be extracted and we should just be left with the overridden object.

      But I still seem to be left with both the objects.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                tirelli Edson Tirelli
                Reporter:
                tirelli Edson Tirelli
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: