lib/openwfe/expressions/fe_sleep.rb in openwferu-0.9.15 vs lib/openwfe/expressions/fe_sleep.rb in openwferu-0.9.16
- old
+ new
@@ -67,12 +67,12 @@
attr_accessor \
:awakening_time
def apply (workitem)
- sfor = lookup_attribute(:for, workitem)
- suntil = lookup_attribute(:until, workitem)
+ sfor = lookup_string_attribute(:for, workitem)
+ suntil = lookup_string_attribute(:until, workitem)
sfor = fetch_text_content(workitem) \
if sfor == nil and suntil == nil
#ldebug { "apply() sfor is '#{sfor}'" }
@@ -96,26 +96,27 @@
end
@awakening_time = tuntil
@applied_workitem = workitem.dup
+ determine_scheduler_tags
+
reschedule(get_scheduler)
end
- #def reply (workitem)
- #end
-
#
# This is the method called by the Scheduler instance attached to
# the workflow engine when the 'sleep' of this expression is
# over
#
def trigger (params)
+
ldebug do
"trigger() #{@fei.to_debug_s} waking up (#{Time.new.to_f}) "+
"(scheduler #{get_scheduler.object_id})"
end
+
reply_to_parent(@applied_workitem)
end
#
# [Re]schedules this expression, effectively registering it within
@@ -135,17 +136,20 @@
@scheduler_job_id = "sleep_#{self.fei.to_s}"
scheduler.schedule_at(
@awakening_time,
- { :schedulable => self, :job_id => @scheduler_job_id })
+ {
+ :schedulable => self,
+ :job_id => @scheduler_job_id,
+ :tags => @scheduler_tags })
ldebug do
"[re]schedule() @scheduler_job_id is '#{@scheduler_job_id}' "+
" (scheduler #{scheduler.object_id})"
end
- store_itself()
+ store_itself
end
end
end