private static void updateNextExpiration(final InternalFactHandle fact,
final InternalWorkingMemory workingMemory,
final WindowMemory memory,
final SlidingTimeWindow stw,
final Object context) {
TimerService clock = workingMemory.getTimerService();
if ( fact != null ) {
long nextTimestamp = ((EventFactHandle) fact).getStartTimestamp() + stw.getSize();
JobContext jobctx = new BehaviorJobContext( workingMemory,
stw,
memory,
context );
JobHandle handle = clock.scheduleJob( job,
jobctx,
new PointInTimeTrigger( nextTimestamp, null, null ) );
jobctx.setJobHandle( handle );
}
}