// DROOLS-455 the calculation of the effectiveEnd may overflow and become negative
long effectiveEnd = ((EventFactHandle) factHandle).getEndTimestamp() + this.expirationOffset;
long nextTimestamp = Math.max( clock.getCurrentTime(),
effectiveEnd >= 0 ? effectiveEnd : Long.MAX_VALUE );
JobContext jobctx = new ExpireJobContext( expire,
workingMemory );
JobHandle handle = clock.scheduleJob( job,
jobctx,
new PointInTimeTrigger( nextTimestamp,
null,
null ) );
jobctx.setJobHandle( handle );
}
}