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

Map Handling with Property Reactive Always Enabled

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Minor
    • None
    • 7.0.0.Final
    • core engine
    • None
    • 2017 Week 24-25
    • Hide

      Rules for us are mostly based off of a strongly-typed class that extends Guava's ForwardingMap<String, ?>

      1. Create rule A based off of a map
      2. Create rule B based off of a map (constrained to changes on A)
      3. Populate the map of rule A from a previous rule
        1. Raise modify() on a property in A
      4. Expect rule B to see the change and fire
        1. B is constrained against a property in A

      Rule B appears to not fire once A has. A was populated by a previous rule.

      Show
      Rules for us are mostly based off of a strongly-typed class that extends Guava's ForwardingMap<String, ?> Create rule A based off of a map Create rule B based off of a map (constrained to changes on A) Populate the map of rule A from a previous rule Raise modify() on a property in A Expect rule B to see the change and fire B is constrained against a property in A Rule B appears to not fire once A has. A was populated by a previous rule.
    • Documentation (Ref Guide, User Guide, etc.), Migration, Compatibility/Configuration
    • Workaround Exists
    • Hide

      The workarounds right now is

      • Add the "<property key="drools.propertySpecific" value="ALLOWED"/>" to the kmodule.xml
      • Use @Watch( * )/ @Watch(!*) on the rules

      Using either of the above approaches will execute all of the rules.

      Show
      The workarounds right now is Add the "<property key="drools.propertySpecific" value="ALLOWED"/>" to the kmodule.xml Use @Watch( * )/ @Watch(!*) on the rules Using either of the above approaches will execute all of the rules.
    • NEW
    • NEW

    Description

      Referencing a conversation on Google Groups - Drools Usage and as requested by Mario Fusco...

      We currently have a ruleset that relies heavily on Map facts. In Drools 6.5 we fire approximately 400 rules.

      In Drools 7.0 we get only about 50 rules unless we add the "<property key="drools.propertySpecific" value="ALLOWED"/>" to the kmodule.xml, in which case we fire the full 400 rules or by using @Watch or @Watch(!*) on the rules. It "seems" like only the first evaluations of the rules are firing and then no others after that.

      Our flow generally follows something like below, within a stateful session, using rules only. We fire all rules per-request then close the session.
      Watch for changes to the Map properties
      If a certain property or properties exist a 'populate' rule fires (calls modify())
      The populate rule enriches the map fact. (calls modify())
      Based on #3, more rules fire when certain properties exist (calls modify())
      We are work heavily with rules that depend on loaded available facts up-front and computed properties throughout evaluation.

      I have a couple of usage questions regarding Drools 7, the default enabling of Property Reactive and using Maps as the facts:
      In general, how do maps work with property reactive and respond to modify/insert events? Does Drools look at the Map as a whole, any change re-evaluates the tree, or each individual property within the map re-evaluates the change?

      In Drools 7, by defaulting the property reactive setting, does that mean all rules need to be annotated or they should they work as is (dao or map-based facts) when using modify/insert?
      For reference, we are relying on this doco https://docs.jboss.org/drools/release/7.0.0.Final/drools-docs/html_single/index.html#_fine_grained_property_change_listeners.

      I am looking into details or an example how to properly use Maps in Drools 7 with Property Reactive features always enabled (as suggested per the doco)....

      Attachments

        Activity

          People

            mfusco@redhat.com Mario Fusco
            kjq KimJohn Quinn (Inactive)
            Mario Fusco
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: