And about the before design : 

rule "Detect it"
        when
                $start : RawEvent()
                not RawEvent(this != $start, id == $start.id, this before[0ms, 
90s]
$start)
        then
                System.out.println($start);
end

I obtain this after a few events have been detected : 

Thread [Thread-0] (Suspended (exception NullPointerException))  

BeforeEvaluatorDefinition$BeforeEvaluator.evaluateCachedLeft(InternalWorkingMemory,
VariableRestriction$VariableContextEntry, Object) line: 343     
        EvaluatorConstraint.isAllowedCachedLeft(ContextEntry, 
InternalFactHandle)
line: 67        
        TripleBetaConstraints.isAllowedCachedLeft(ContextEntry[],
InternalFactHandle) line: 199   
        NotNode.retractRightTuple(RightTuple, PropagationContext,
InternalWorkingMemory) line: 183        
        ObjectTypeNode.retractObject(InternalFactHandle, PropagationContext,
InternalWorkingMemory) line: 283        

ReteooWorkingMemory$WorkingMemoryReteExpireAction.execute(InternalWorkingMemory)
line: 514       
        ReteooStatefulSession(AbstractWorkingMemory).executeQueuedActions() 
line:
977     
        DefaultAgenda.fireUntilHalt(AgendaFilter) line: 1422    
        ReteooStatefulSession(AbstractWorkingMemory).fireUntilHalt(AgendaFilter)
line: 755       
        ReteooStatefulSession(AbstractWorkingMemory).fireUntilHalt() line: 731  
        StatefulKnowledgeSessionImpl.fireUntilHalt() line: 247  
        DroolsTest$rulesThread.run() line: 45   

As you said, the before and after design should react the same way. I work
in stream mode with a pseudo clock i advance every time i insert an event to
the precise time the event to be inserted is dated. (If that can help in
anything)



--
View this message in context: 
http://drools.46999.n3.nabble.com/before-after-behavior-for-negative-pattern-tp4019497p4019500.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to