[jboss-jira] [JBoss JIRA] Commented: (JBRULES-2825) rule with timer and CE not keeps firing after turning false

Wolfgang Laun (JIRA) jira-events at lists.jboss.org
Tue Mar 29 07:16:38 EDT 2011


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

Wolfgang Laun commented on JBRULES-2825:
----------------------------------------

A similar effect can be seen with the SECOND of these two rules (rule_b). It will fire every second, even though the LHS turns to false. In contrast, the FIRST rule (rule_a) works correctly.

(timer usn't necessary in either case, but it could be!)

rule "rule_a"
timer (int: 1s 1s) 
when 
    SimpleClock ( $dim: dateInMillisec != 0 )
    m : Message ( $ied: internalEndDate < $dim )
then 
    System.out.println( "rule a: " + $dim + " > " + $ied );
    retract (m);
    m.setInternalEndDate ($dim + 10000); 
    insert (m);
end

rule "rule_b"
timer (int:1s 1s)
when 
    SimpleClock ( $dim : dateInMillisec != 0 )  // Simple slock give the current time (set by a java timer and an update)
    m: Message ( $ied: internalEndDate < $dim )
then 
    System.out.println( "rule b: " + $dim + " > " + $ied );
    m.setInternalEndDate ($dim + 10000); 
    update (m);
end


> rule with timer and CE not keeps firing after turning false
> -----------------------------------------------------------
>
>                 Key: JBRULES-2825
>                 URL: https://issues.jboss.org/browse/JBRULES-2825
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: drools-core
>    Affects Versions: 5.1.1.FINAL
>            Reporter: Wolfgang Laun
>            Assignee: Mark Proctor
>            Priority: Critical
>             Fix For: 5.2.0.M1
>
>
> rule "wrap A"
> timer(int: 100 100)
> when
>     $a: A( $id: id )
>     not B( a == $a )
> then
>     B b = new B( $a );
>     insert( b );
> end
> See  TimerAndCalendarTest.testTimerWithNot() and test_Timer_With_Not.drl

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list