[jboss-jira] [JBoss JIRA] (JBRULES-3686) Wrong type declartion initialization causes an infinite loop when using property reactivity

Mario Fusco (JIRA) jira-events at lists.jboss.org
Thu Nov 15 11:11:21 EST 2012


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

Mario Fusco updated JBRULES-3686:
---------------------------------

    Description: 
A drl like the following with DataSample being annotated as @PropertyReactive ends up in an infinite loop even if it shouldn't.

rule 'Init'
when
    $m: Model()
then
    insert(new DataSample($m));
end

rule "Rule 1"
when
    $m: Model()
    $d: DataSample(model == $m)
then
    modify($d){
        addValue(Parameter.PARAM_A, 10.0)
    }
end

rule "Rule 2"
when
    $m: Model()
    $d: DataSample(model == $m, $v: values[Parameter.PARAM_A] > 9.0)
then
    modify($d){
        addMessage("Hello")
    }
end

rule "Data without messages"
salience -100
when
    $m: Model()
    $d: DataSample(model == $m, messaged == false)
then
end


  was:
A drl like the following with DataSample being annotated as @PropertyReactive ends up in an infinite loop even if it shouldn't.

rule 'Init'
when
    $m: Model()
then
    System.out.println("Inserting a DataSample");
    insert(new DataSample($m));
end

rule "Rule 1"
when
    $m: Model()
    $d: DataSample(model == $m)
then
    System.out.println(drools.getRule().getName());

    modify($d){
        addValue(Parameter.PARAM_A, 10.0)
    }
end

rule "Rule 2"
when
    $m: Model()
    $d: DataSample(model == $m, $v: values[Parameter.PARAM_A] > 9.0)
then
    System.out.println(drools.getRule().getName());

    modify($d){
        addMessage("Hello")
    }
end

rule "Data without messages"
salience -100
when
    $m: Model()
    $d: DataSample(model == $m, messaged == false)
then
    System.out.println(drools.getRule().getName());
end



    
> Wrong type declartion initialization causes an infinite loop when using property reactivity
> -------------------------------------------------------------------------------------------
>
>                 Key: JBRULES-3686
>                 URL: https://issues.jboss.org/browse/JBRULES-3686
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>            Reporter: Mario Fusco
>            Assignee: Mario Fusco
>
> A drl like the following with DataSample being annotated as @PropertyReactive ends up in an infinite loop even if it shouldn't.
> rule 'Init'
> when
>     $m: Model()
> then
>     insert(new DataSample($m));
> end
> rule "Rule 1"
> when
>     $m: Model()
>     $d: DataSample(model == $m)
> then
>     modify($d){
>         addValue(Parameter.PARAM_A, 10.0)
>     }
> end
> rule "Rule 2"
> when
>     $m: Model()
>     $d: DataSample(model == $m, $v: values[Parameter.PARAM_A] > 9.0)
> then
>     modify($d){
>         addMessage("Hello")
>     }
> end
> rule "Data without messages"
> salience -100
> when
>     $m: Model()
>     $d: DataSample(model == $m, messaged == false)
> then
> end

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list