public boolean isEffective ( Tuple tuple , RuleTerminalNode rtn , WorkingMemory workingMemory ) { if ( ! this . enabled . getValue ( tuple , rtn . getEnabledDeclarations ( ) , this , workingMemory ) ) { return false ; } if ( this . dateEffective == null && this . dateExpires == null ) { return true ; } else { Calendar now = Calendar . getInstance ( ) ; now . setTimeInMillis ( workingMemory . getSessionClock ( ) . getCurrentTime ( ) ) ; if ( this . dateEffective != null && this . dateExpires != null ) { return ( now . after ( this . dateEffective ) && now . before ( this . dateExpires ) ) ; } else if ( this . dateEffective != null ) { return ( now . after ( this . dateEffective ) ) ; } else { return ( now . before ( this . dateExpires ) ) ; } } }
This returns true is the rule is effective . If the rule is not effective it cannot activate .