[jboss-jira] [JBoss JIRA] (DROOLS-335) Inconsistency between ReteOO and PHREAK on test with temporal reasoning and dynamic salience.

Duncan Doyle (JIRA) issues at jboss.org
Thu May 15 03:47:56 EDT 2014


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

Duncan Doyle commented on DROOLS-335:
-------------------------------------

I checked my reproducer, and it turns out the reproducer is wrong (configuration of the event processing mode was not correctly set and I forgot to correctly forward the PseudoClock'.

However, I compiled a new test, which you can find here: https://github.com/DuncanDoyle/DroolsInOrderTemporalReasoningPhreakIssue2 , which shows a problem temporal reasoning and dynamic salience in PHREAK. Again, run 'mvn clean test -P reteoo', and the test will succeed, run 'mvn clean test -P phreak' and the test will fail.

The idea behind the rule is ignore the first 4 events of a certain type, and send the 5th to an output channel. The events are inserted into the KieSession in a batch (say 40 inserts) while moving the PseudoClock forward. After the inserts, KieSession.fireAllRules() is called. The trick here is that in order for the temporal reasoning in the Accumulate to work, the rules need to fire in the order of the timestamp of the events, otherwise the temporal reasoning breaks. Therefore I use a dynamic salience in the rule, which uses the index of the event as salience value, to fire the rules in the correct order.

Now, with ReteOO, this works fine, but the behaviour with PHREAK is different (and fails the test). The behaviour is consistent though, it seems that after event 4 (index=4) fires the rule to mark the event as "TO_SEND", the next that get's filtered is event 39 (instead of 5). Than, when event 9 get's marked for TO_SEND, the next event filtered is 38, etc.etc. So it seems that after "TECH-Ignore_first_4_K08_events" marks an event as TO_SEND, and "TECH-rule-Retract_filtered_events_after_send." retracts that event, the next event filtered is the last one instead of the next one. So, it seems to process some rules in reverse order.

> Inconsistency between ReteOO and PHREAK on test with temporal reasoning and dynamic salience.
> ---------------------------------------------------------------------------------------------
>
>                 Key: DROOLS-335
>                 URL: https://issues.jboss.org/browse/DROOLS-335
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 6.0.0.CR5
>         Environment: Mac OS-X 10.9, Oracle Hotspot 1.7.0_45
>            Reporter: Duncan Doyle
>            Assignee: Mark Proctor
>              Labels: phreak
>
> Reproducer at: https://github.com/DuncanDoyle/DroolsInOrderTemporalReasoningPhreakIssue
> Clone the project in the given GitHub repository and run 'mvn -Preteoo clean test'. The test will pass. Next, run 'mvn -Pphreak clean test', both tests fail.



--
This message was sent by Atlassian JIRA
(v6.2.3#6260)


More information about the jboss-jira mailing list