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

updateToVersion unexpectedly overwrites ObjectTypeNode.expirationOffset of super type

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.54.0.Final
    • 7.53.0.Final
    • core engine
    • None
    • 2021 Week 16-18 (from Apr 19)
    • 2
    • Undefined
    • NEW
    • NEW

    Description

      For example, you have Event class and its subclass AEvent. You declare AEvent as @role( event ) with @expires

      declare AEvent
         @role( event )
         @timestamp( eventTimestamp )
         @expires(3d)
      end;
      

      You have a rule for AEvent but also a rule for the super class, Event.

      rule "detect AEvent"
      when $e: AEvent()
      then
          System.out.println("detect AEvent");
      end
      
      rule "detect Event"
      when $e: Event()
      then
         System.out.println("detect Event");
      end
      

      In this case, ObjectTypeNode are created for those classes. For Event, it's ObjectTypeNode.expirationOffset is -1 (because @expires is not defined). But when you trigger KieContainer.updateToVersion(), the ObjectTypeNode.expirationOffset is overwritten by AEvent's ObjectTypeNode.expirationOffset (= 3 day).

      Attachments

        Issue Links

          Activity

            People

              rhn-support-tkobayas Toshiya Kobayashi
              rhn-support-tkobayas Toshiya Kobayashi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: