[jboss-jira] [JBoss JIRA] (DROOLS-1256) ForceEagerActivationOption and "not()" LHS pattern does not invoke matchCreated listener

Matteo Mortari (JIRA) issues at jboss.org
Wed Aug 31 04:03:00 EDT 2016


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

Matteo Mortari commented on DROOLS-1256:
----------------------------------------

Typical steps of creation and usage of the session with the listener is as follows:
# create the KieSession
# register the listener
# fireAllRules() - or fireUntilHalt()
the same is also outlined in the reported test.

However with the rules as described here, and the option {{ForceEagerActivationOption.YES}} enabled, the matchCreated events are happening contextually to step 1, hence _before_  the listener gets to be actually registered.

> ForceEagerActivationOption and "not()" LHS pattern does not invoke matchCreated listener
> ----------------------------------------------------------------------------------------
>
>                 Key: DROOLS-1256
>                 URL: https://issues.jboss.org/browse/DROOLS-1256
>             Project: Drools
>          Issue Type: Bug
>          Components: core engine
>    Affects Versions: 7.0.0.Beta1
>            Reporter: Matteo Mortari
>            Assignee: Matteo Mortari
>            Priority: Minor
>
> Given the following rules 
> {code:java}
> rule ND
> when
>     not ( Double() ) 
> then
>     // do nothing. 
> end
> rule ND2
> salience 1
> when
>     not ( Double() ) 
> then
>     insert( new Double(0) ); 
> end
> {code}
> and KieSession created with {{ForceEagerActivationOption.YES}} and a generic AgendaEventListener on fire all rules returns:
> {code:java}
>  created: 0 cancelled: 1 fired: 1
> {code}
> hence incoherent as matchcreated .
> Expected: created=2, cancelled=1, fired=1.
> Reporting this as also I understand this eager option is used by jBPM.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list