Class | OpenWFE::TimeExpression |
In: |
lib/openwfe/expressions/time.rb
|
Parent: | FlowExpression |
A parent class for CronExpression and SleepExpression, is never used directly. It contains a simple get_scheduler() method simplifying the scheduler localization for <sleep/> and <cron/>.
applied_workitem | [RW] | The workitem received at apply time |
scheduler_job_id | [RW] | The job_id in the scheduler for this expression |
scheduler_tags | [RW] | The tags (if any) for the job in the scheduler |
If the expression has been scheduled, a call to this method will make sure it‘s unscheduled (removed from the scheduler).
# File lib/openwfe/expressions/time.rb, line 91 91: def unschedule 92: 93: ldebug { "unschedule() @scheduler_job_id is #{@scheduler_job_id}" } 94: 95: sleep get_scheduler.precision + 0.001 96: # 97: # make sure not to unschedule before the actual scheduling 98: # got done. 99: 100: get_scheduler.unschedule(@scheduler_job_id) \ 101: if @scheduler_job_id 102: end
looks up potential scheduler tags in the expression attributes
# File lib/openwfe/expressions/time.rb, line 110 110: def determine_scheduler_tags 111: 112: st = lookup_attribute :scheduler_tags, @applied_workitem 113: 114: @scheduler_tags = if st 115: st.split(",").collect { |s| s.strip } 116: else 117: [] 118: end 119: @scheduler_tags << self.class.name 120: end