lib/ruote/exp/fe_wait.rb in ruote-2.2.0 vs lib/ruote/exp/fe_wait.rb in ruote-2.3.0
- old
+ new
@@ -1,7 +1,7 @@
#--
-# Copyright (c) 2005-2011, John Mettraux, jmettraux@gmail.com
+# Copyright (c) 2005-2012, John Mettraux, jmettraux@gmail.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@@ -54,42 +54,29 @@
def apply
h.for = attribute(:for) || attribute_text
h.until = attribute(:until)
- s = h.for
- s = h.until if s == ''
+ h.at = h.for
+ h.at = h.until if h.at == ''
- h.at = s
+ return reply_to_parent(h.applied_workitem) unless h.at
- if h.at
+ h.schedule_id = @context.storage.put_schedule(
+ 'at',
+ h.fei,
+ h.at,
+ 'action' => 'reply',
+ 'fei' => h.fei,
+ 'workitem' => h.applied_workitem)
- h.schedule_id = @context.storage.put_schedule(
- 'at',
- h.fei,
- h.at,
- 'action' => 'reply',
- 'fei' => h.fei,
- 'workitem' => h.applied_workitem)
-
- persist_or_raise
-
- else
-
- reply_to_parent(h.applied_workitem)
- end
+ persist_or_raise
end
#--
# no need to override, simply reply to parent expression.
#def reply (workitem)
#end
#++
-
- def cancel(flavour)
-
- @context.storage.delete_schedule(h.schedule_id)
- reply_to_parent(h.applied_workitem)
- end
end
end