Add the given {@link org.quartz.JobDetail} to the Scheduler, and associate the given {@link Trigger} with it.
{@link org.quartz.JobDetail}
{@link Trigger}
If the given Trigger does not reference any Job, then it will be set to reference the Job passed with it into this method.
Job
720721722723724725726727728729730
TimerService clock = inCtx.wm.getTimerService(); JobContext jobctx = new ExpireJobContext( new WorkingMemoryReteExpireAction(factHandle, otn), inCtx.wm ); JobHandle handle = clock.scheduleJob( job, jobctx, new PointInTimeTrigger( _expire.getNextFireTimestamp(), null, null ) ); jobctx.setJobHandle( handle );
697698699700701702703704705706707
TimerService clock = inCtx.wm.getTimerService(); JobContext jobctx = new ExpireJobContext( new WorkingMemoryReteExpireAction( factHandle, otn ), inCtx.wm ); JobHandle handle = clock.scheduleJob( job, jobctx, new PointInTimeTrigger( nextTimeStamp, null, null ) ); jobctx.setJobHandle( handle );
718719720721722723724725726727728
300301302303304305306307308309310
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 );
228229230231232233234235236237238
// but the engine silently accepts them anyway, resulting in possibly undesirable behaviors workingMemory.queueWorkingMemoryAction( new BehaviorExpireWMAction( nodeId, stw, memory, context, pctx ) ); } else { JobContext jobctx = new BehaviorJobContext( nodeId, workingMemory, stw, memory, context, pctx); JobHandle handle = clock.scheduleJob( job, jobctx, new PointInTimeTrigger( nextTimestamp, null, null ) ); jobctx.setJobHandle( handle ); } }
298299300301302303304305306307308
long nextTimestamp = Math.max( clock.getCurrentTime(), ((EventFactHandle) factHandle).getEndTimestamp() + this.expirationOffset ); JobContext jobctx = new ExpireJobContext( expire, workingMemory ); JobHandle handle = clock.scheduleJob( job, jobctx, new PointInTimeTrigger( nextTimestamp, null, null ) ); jobctx.setJobHandle( handle );
695696697698699700701702703704705