Methods

Class/Module Index [+]

Quicksearch

Ruote::Exp::SaveExpression

Saves the current workitem fields into a variable or into a field.

save :to_field => 'old_workitem'
  #
  # saves a copy of the fields of the current workitem into itself,
  # in the field named 'old_workitem'

save :to_variable => '/wix'
  #
  # saves a copy of the current workitem in the varialbe 'wix' at
  # the root of the process

See also the 'restore' expression (Ruote::Exp::RestoreExpression).

Public Instance Methods

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

  tk =
    has_attribute(*] v var variable ].map { |k| "to_#{k}" }) ||
    has_attribute(*] f fld field ].map { |k| "to_#{k}" })

  return reply_to_parent(h.applied_workitem) unless tk

  key = attribute(tk)

  if tk.match(/^to_v/)

    set_variable(key, h.applied_workitem['fields'])

  elsif tk.match(/^to_f/)

    Ruote.set(
      h.applied_workitem['fields'],
      key,
      Ruote.fulldup(h.applied_workitem['fields']))
  end

  reply_to_parent(h.applied_workitem)
end
reply(workitem) click to toggle source
# File lib/ruote/exp/fe_save.rb, line 73
def reply (workitem)

  # empty, never called
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.