[jboss-jira] [JBoss JIRA] (DROOLS-4896) Accumulate: min with BigDecimal doesn't work as expected when drools.propertySpecific=ALLOWED

Hiroko Miura (Jira) issues at jboss.org
Thu Dec 26 00:48:47 EST 2019


     [ https://issues.redhat.com/browse/DROOLS-4896?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hiroko Miura updated DROOLS-4896:
---------------------------------
    Description: 
Regarding accumulate, min function with BigDecimal does not work as expected when drools.propertySpecific is "ALLOWED".

The following rule worked with BRMS6.1.4(6.2.0.Final-redhat-13).

{noformat}
rule "rule1_BigDecimal"
    agenda-group "BigDecimal"
    when  
        accumulate( Fact( $bdVal: bdVal), $minVal : min($bdVal))
        accumulate( Fact( $bdVal2: bdVal, $bdVal2 > $minVal), $minVal2 : min($bdVal2))
     
        $minFact: Fact( bdVal == new BigDecimal($minVal.intValue()))
        $minFact2: Fact( bdVal == new BigDecimal($minVal2.intValue()))
    then
    ...
 end
{noformat}

But after upgrading to RHPAM 7 and setting drools.propertySpecific=ALLOWED, this does not work.
i.e. rule  fires one more time than expected even though there is only one fact at the last iteration. 

This does not happen at least with Long type.

  was:
Regarding accumulate, min function with BigDecimal does not work as expected when drools.propertySpecific is "ALLOWED".

The following rule worked with BRMS6.1.4(6.2.0.Final-redhat-13).

{noformat}
rule "rule1_BigDecimal"
    agenda-group "BigDecimal"
    when  
        accumulate( Fact( $bdVal: bdVal), $minVal : min($bdVal))
        accumulate( Fact( $bdVal2: bdVal, $bdVal2 > $minVal), $minVal2 : min($bdVal2))
     
        $minFact: Fact( bdVal == new BigDecimal($minVal.intValue()))
        $minFact2: Fact( bdVal == new BigDecimal($minVal2.intValue()))
    then
    ...
 end
{noformat}

But after upgrading to RHPAM 7 and setting drools.propertySpecific=ALLOWED, this does not work.
i.e. rule  fires one more time than expected even though there is only one fact at the last iteration. 



> Accumulate: min with BigDecimal doesn't work as expected when drools.propertySpecific=ALLOWED
> ---------------------------------------------------------------------------------------------
>
>                 Key: DROOLS-4896
>                 URL: https://issues.redhat.com/browse/DROOLS-4896
>             Project: Drools
>          Issue Type: Bug
>          Components: core engine
>    Affects Versions: 7.14.0.Final, 7.26.0.Final, 7.31.0.Final
>            Reporter: Hiroko Miura
>            Assignee: Mario Fusco
>            Priority: Major
>              Labels: support
>         Attachments: bigdecimal-accumulate-test.zip
>
>
> Regarding accumulate, min function with BigDecimal does not work as expected when drools.propertySpecific is "ALLOWED".
> The following rule worked with BRMS6.1.4(6.2.0.Final-redhat-13).
> {noformat}
> rule "rule1_BigDecimal"
>     agenda-group "BigDecimal"
>     when  
>         accumulate( Fact( $bdVal: bdVal), $minVal : min($bdVal))
>         accumulate( Fact( $bdVal2: bdVal, $bdVal2 > $minVal), $minVal2 : min($bdVal2))
>      
>         $minFact: Fact( bdVal == new BigDecimal($minVal.intValue()))
>         $minFact2: Fact( bdVal == new BigDecimal($minVal2.intValue()))
>     then
>     ...
>  end
> {noformat}
> But after upgrading to RHPAM 7 and setting drools.propertySpecific=ALLOWED, this does not work.
> i.e. rule  fires one more time than expected even though there is only one fact at the last iteration. 
> This does not happen at least with Long type.



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the jboss-jira mailing list