Details

    • Type: Enhancement
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Sprint:
      2019 Week 41-43 (from Okt 7)
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      At the moment a single pattern forall statement like

      forall( Type( constraints ) )
      

      it is automatically rewritten as

      forall( $t : Type() Type( this == $t, constraints ) )
      

      and then implemented with 2 not nodes and join.

      [EntryPointNode(1) EntryPoint::DEFAULT ] on Partition(MAIN)
          [ObjectTypeNode(4)::EntryPoint::DEFAULT objectType=[ClassObjectType class=org.drools.testcoverage.common.model.Person] expiration=-1ms ] on Partition(MAIN)
              [JoinNode(5) - [ClassObjectType class=org.drools.testcoverage.common.model.Person]] on Partition(1) Ld -1 Li -1 Rd 0 Ri 0
                  [NotNode(7) - [ClassObjectType class=org.drools.testcoverage.common.model.Person]] on Partition(1) Ld -1 Li -1 Rd 9223372036854775807 Ri 9223372036854775807
                      RightInputAdapterNode(8)[ tupleMemoryEnabled=true, tupleSource=[NotNode(7) - [ClassObjectType class=org.drools.testcoverage.common.model.Person]], source=null, associations={[Rule name=R1, agendaGroup=MAIN, salience=0, no-loop=false]=1}, partitionId=Partition(1)] on Partition(1)
                          [NotNode(9) - <source from a subnetwork>] on Partition(1) Ld 0 Li 0 Rd -1 Ri -1
                              [RuleTerminalNode(10): rule=R1] on Partition(1) d -1 i -1
              [AlphaNode(6) constraint=!(age >= 18) || !(name.startsWith("M"))] on Partition(1) d 2056 i 9223372036854775807
                  [NotNode(7) - [ClassObjectType class=org.drools.testcoverage.common.model.Person]] on Partition(1) Ld -1 Li -1 Rd 9223372036854775807 Ri 9223372036854775807
          [ObjectTypeNode(2)::EntryPoint::DEFAULT objectType=[ClassObjectType class=org.drools.core.reteoo.InitialFactImpl] expiration=-1ms ] on Partition(MAIN)
              [LeftInputAdapterNode(3)] on Partition(1) Ld 0 Li 0
                  [JoinNode(5) - [ClassObjectType class=org.drools.testcoverage.common.model.Person]] on Partition(1) Ld -1 Li -1 Rd 0 Ri 0
                  [NotNode(9) - <source from a subnetwork>] on Partition(1) Ld 0 Li 0 Rd -1 Ri -1
      

      It would be much faster to rewrite it as

      not( Type( !constraints ) )
      

      and then evaluate it with one single not node.

      [EntryPointNode(1) EntryPoint::DEFAULT ] on Partition(MAIN)
          [ObjectTypeNode(4)::EntryPoint::DEFAULT objectType=[ClassObjectType class=org.drools.testcoverage.common.model.Person] expiration=-1ms ] on Partition(MAIN)
              [AlphaNode(5) constraint=!(age >= 18) || !(name.startsWith("M"))] on Partition(1) d 2056 i 2056
                  [NotNode(6) - [ClassObjectType class=org.drools.testcoverage.common.model.Person]] on Partition(1) Ld -1 Li -1 Rd 0 Ri 2056
                      [RuleTerminalNode(7): rule=R1] on Partition(1) d -1 i -1
          [ObjectTypeNode(2)::EntryPoint::DEFAULT objectType=[ClassObjectType class=org.drools.core.reteoo.InitialFactImpl] expiration=-1ms ] on Partition(MAIN)
              [LeftInputAdapterNode(3)] on Partition(1) Ld 0 Li 0
                  [NotNode(6) - [ClassObjectType class=org.drools.testcoverage.common.model.Person]] on Partition(1) Ld -1 Li -1 Rd 0 Ri 2056
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mfusco Mario Fusco
                  Reporter:
                  mfusco Mario Fusco
                  Tester:
                  Tibor Zimanyi
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: