[jboss-jira] [JBoss JIRA] (DROOLS-1763) Dependent rule not firing

Mario Fusco (JIRA) issues at jboss.org
Mon Nov 27 02:54:00 EST 2017


    [ https://issues.jboss.org/browse/DROOLS-1763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493967#comment-13493967 ] 

Mario Fusco commented on DROOLS-1763:
-------------------------------------

In Drools 7 we enabled property reactivity by default http://docs.jboss.org/drools/release/7.3.0.Final/drools-docs/html_single/#_property_reactivity_enabled_by_default

This feature is explained in more details here http://docs.jboss.org/drools/release/7.3.0.Final/drools-docs/html_single/#_fine_grained_property_change_listeners

Since your methods are called addX instead of setX Drools is not able in your case to figure out which property of your domain object is changed and then it doesn't propagate any change. If possible you can annotate your addX method of your beans to say which properties they affect. Otherwise you can explicitly say which property are changed using an update statement. If all this solutions are not reasonable for you, you can disable property reactivity either completely or only for that class. I strongly suggest to keep property reactivity on and use one of the other solution I advised if possible: we enabled property reactivity by default because it represent a good improvement both when writing rules and performance wise.

Please let me know if this worked for you otherwise I will investigate this issue further.

> Dependent rule not firing
> -------------------------
>
>                 Key: DROOLS-1763
>                 URL: https://issues.jboss.org/browse/DROOLS-1763
>             Project: Drools
>          Issue Type: Bug
>    Affects Versions: 7.0.0.Beta7, 7.3.0.Final
>         Environment: Linux all versions.
> JDK 1.8.0 Update 144
>            Reporter: David Wade
>            Assignee: Mario Fusco
>         Attachments: 7.0.0.Beta6.txt, 7.3.0.Final.txt
>
>
> We have been using Drools since 2.x.   
> Currently we use 7.0.0.Beta6 which works.
> We can't upgrade because since 7.0.0.Beta7 rules dependent on the consequence of another rule are not firing for some reason.  This happens for us on 7.0.0.Beta7 through to 7.3.0.Final.
> Consider the following two rules.   When run on 7.0.0.Beta6 both rules fire.    From Beta7 through to 7.3.0.Final, only the SQ rule fire, despite the RC rule passing its conditions
> {code}
> rule "H2"
>   salience -300
>   when
>     segment:SegmentWithTax(
>       containsTax("SQ")
>       , notContainsTax("H2", "RC")
>     )
>   then
>     segment.addPercentageTaxEntry(taxCodeMap,"SQ","RC_13_PERCENT");
> end
> rule "SQ"
>   when
>     segment:SegmentWithTax(
>       !containsTax("SQ")
>     ) 
>   then
>     modify(segment) {
>       addTaxEntry(taxCodeMap,"SQ_TRANSFER_TRANSIT_LESS_THAN_FOUR_HOURS")
>     }
> end
> {code}
> Will attach Drools trace logging output * 2.   One for  [^7.0.0.Beta6.txt] , one for  [^7.3.0.Final.txt] .



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list