[jboss-jira] [JBoss JIRA] (DROOLS-3606) From with modify fires unexpected rule

Toshiya Kobayashi (Jira) issues at jboss.org
Tue Feb 5 20:45:01 EST 2019


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

Toshiya Kobayashi updated DROOLS-3606:
--------------------------------------
    Description: 
The rules below expect that only "R1" is fired when Person ("John", 20) is inserted. However, "R2" is also fired though age is set to 5 in modify block.

{noformat}
rule "R1"
    salience 1
    when
        $p : Person()
        Person( age > 10 ) from $p 
    then
        modify ($p) {
          setAge(5);
        }
        System.out.println( "R1, " + $p);
end

rule "R2"
    salience 0
    when
        $p : Person()
        Person( age > 10 ) from $p 
    then
        System.out.println( "R2, " + $p);
end
{noformat}


  was:
The rules below expect that only "R1" is fired. However, "R2" is also fired though age is set to 5 in modify block.

{noformat}
rule "R1"
    salience 1
    when
        $p : Person()
        Person( age > 10 ) from $p 
    then
        modify ($p) {
          setAge(5);
        }
        System.out.println( "R1, " + $p);
end

rule "R2"
    salience 0
    when
        $p : Person()
        Person( age > 10 ) from $p 
    then
        System.out.println( "R2, " + $p);
end
{noformat}




> From with modify fires unexpected rule
> --------------------------------------
>
>                 Key: DROOLS-3606
>                 URL: https://issues.jboss.org/browse/DROOLS-3606
>             Project: Drools
>          Issue Type: Bug
>          Components: core engine
>    Affects Versions: 7.17.0.Final
>            Reporter: Toshiya Kobayashi
>            Assignee: Mario Fusco
>            Priority: Major
>              Labels: support
>
> The rules below expect that only "R1" is fired when Person ("John", 20) is inserted. However, "R2" is also fired though age is set to 5 in modify block.
> {noformat}
> rule "R1"
>     salience 1
>     when
>         $p : Person()
>         Person( age > 10 ) from $p 
>     then
>         modify ($p) {
>           setAge(5);
>         }
>         System.out.println( "R1, " + $p);
> end
> rule "R2"
>     salience 0
>     when
>         $p : Person()
>         Person( age > 10 ) from $p 
>     then
>         System.out.println( "R2, " + $p);
> end
> {noformat}



--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the jboss-jira mailing list