[jboss-jira] [JBoss JIRA] (DROOLS-327) PHREAK goes into infinite loop, even with 'no-loop' defined.

Duncan Doyle (JIRA) jira-events at lists.jboss.org
Thu Nov 7 07:48:02 EST 2013


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

Duncan Doyle commented on DROOLS-327:
-------------------------------------

Just did some more testing. If you remove the 'Conditional Named Consequence', the 'no-loop' does work as expected, i.e.:

rule "Hello World" dialect "java"
	no-loop
    when
        m : Message( myMessage : message )
    //    if (m.getStatus() == 0) do [sayHello]
    then
        System.out.println( myMessage );
        m.setMessage( "Goodbye cruel world" );
        m.setStatus( Message.GOODBYE );
        update( m );
    //then[sayHello]
   	//	System.out.println("Hello, I'm here!");
end
                
> PHREAK goes into infinite loop, even with 'no-loop' defined.
> ------------------------------------------------------------
>
>                 Key: DROOLS-327
>                 URL: https://issues.jboss.org/browse/DROOLS-327
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 6.0.0.CR5
>         Environment: Mac OS-X 10.9, JBoss Developer Studio 7, Oracle Hotspot 1.7.0_45
>            Reporter: Duncan Doyle
>            Assignee: Mark Proctor
>              Labels: infinite, loop, no-loop, phreak
>
> See this project on my Github: https://github.com/DuncanDoyle/DroolsPhreakConditionalNamedConsequenceInfiniteLoopIssue
> The 'src/main/resources/rules/Sample.drl' contains an adapted version of the default Drools Eclipse plugin sample rule. As you can see, the rule uses Conditional Named Consequence construct. Although the rule is a bit strange (the issue actuallty popped up while debugging another issue) it does show different behaviour between ReteOO and PHREAK, where in this case PHREAK actually goes into an infinitie-loop, even though 'no-loop' has been defined on the "Hello World" rule.
> To run the sample using ReteOO:
> - mvn -Preteoo exec:java
> The (correct) output is:
> Hello World
> Goodbye cruel world
> To run the sample using PHREAK
> - mvn -Pphreak exec:java
> The incorrect output is:
> Hello, I'm here!
> Hello World
> Goodbye cruel world
> Goodbye cruel world
> Goodbye cruel world
> Goodbye cruel world
> Goodbye cruel world
> {infinite loop}
> Note that the PHREAK run also prints "Hello, I'm here!" and ReteOO doesn't (because the activation of that rule is canceled when the Message is updated with a new message and status).

--
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