Methods

Class/Module Index [+]

Quicksearch

Ruote::Exp::WaitExpression

Waits (sleeps) for a given period of time before resuming the flow.

sequence do
  accounting :task => 'invoice'
  wait '30d' # 30 days
  accounting :task => 'check if customer paid'
end

'_sleep' is also OK

_sleep '7d10h' # 7 days and 10 hours

(the underscore prevents collision with Ruby's sleep method)

:for and :until

TODO

Public Instance Methods

apply() click to toggle source
# File lib/ruote/exp/fe_wait.rb, line 51
def apply

  h.for = attribute(:for) || attribute_text
  h.until = attribute(:until)

  s = h.for
  s = h.until if s == ''

  h.at = s

  if h.at

    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
end
cancel(flavour) click to toggle source
# File lib/ruote/exp/fe_wait.rb, line 85
def cancel (flavour)

  @context.storage.delete_schedule(h.schedule_id)
  reply_to_parent(h.applied_workitem)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.