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

Wrong BitMask created by a nested property in modify block

    Details

    • Sprint:
      2020 Week 13-15 (from Mar 23), 2020 Week 16-18 (from Apr 13)
    • Story Points:
      3
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      When a nested property is modified in modify block like this:

      rule R1
      when 
        $pet : Pet(age == 3)
      then
        modify ($pet) { getOwner().setLikes("Cookie") };
      end
      

      executable model creates BitMask for "owner" and "likes" thus causes a build error.

      [ERROR] testNestedPropInRHS[PATTERN_DSL](org.drools.modelcompiler.PropertyReactivityTest)  Time elapsed: 2.702 s  <<< ERROR!
      java.lang.RuntimeException: Unknown property 'likes' for class class class org.drools.modelcompiler.domain.Pet
      	at org.drools.test.DomainClassesMetadata9429289867DBA6AE1EE0D6F3F6F68A4D$org_drools_modelcompiler_domain_Pet_Metadata.getPropertyIndex(DomainClassesMetadata9429289867DBA6AE1EE0D6F3F6F68A4D.java:24)
      	at org.drools.model.bitmask.BitMaskUtil.calculatePatternMask(BitMaskUtil.java:61)
      	at org.drools.model.BitMask.getPatternMask(BitMask.java:54)
      	at org.drools.test.Rules9429289867DBA6AE1EE0D6F3F6F68A4DRuleMethods0.rule_R1(Rules9429289867DBA6AE1EE0D6F3F6F68A4DRuleMethods0.java:24)
      	at org.drools.test.Rules9429289867DBA6AE1EE0D6F3F6F68A4D.getRulesList(Rules9429289867DBA6AE1EE0D6F3F6F68A4D.java:60)
      	at org.drools.test.Rules9429289867DBA6AE1EE0D6F3F6F68A4D.<init>(Rules9429289867DBA6AE1EE0D6F3F6F68A4D.java:64)
      	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
      	at java.base/java.lang.Class.newInstance(Class.java:584)
      	at org.drools.modelcompiler.CanonicalKieModule.createInstance(CanonicalKieModule.java:410)
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  tkobayashi Toshiya Kobayashi
                  Reporter:
                  tkobayashi Toshiya Kobayashi
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: