Class: Ruote::Exp::SaveExpression

Inherits:
FlowExpression show all
Defined in:
lib/ruote/exp/fe_save.rb

Overview

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

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

save :to_variable => '/wix'
  # or
save :to => 'v:/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).

Constant Summary

Constant Summary

Constants inherited from FlowExpression

FlowExpression::COMMON_ATT_KEYS

Instance Attribute Summary

Attributes inherited from FlowExpression

#context, #error

Instance Method Summary collapse

Methods inherited from FlowExpression

#ancestor?, #applied_workitem, #att, #att_text, #attribute, #attribute_text, #attributes, #await, #cancel, #cancel_flanks, #cfei_at, #child_id, #child_ids, #compile_atts, #compile_variables, #debug_id, #deflate, #do, do_action, #do_apply, #do_cancel, #do_fail, #do_pause, #do_persist, #do_reply, #do_reply_to_parent, #do_resume, #do_unpersist, dummy, #fei, fetch, from_h, #handle_on_error, #has_attribute, #initial_persist, #initialize, #is_concurrent?, #iterative_var_lookup, #launch_sub, #lookup_val, #lookup_val_prefix, #lookup_variable, #name, names, #parent, #parent_id, #pause_on_apply, #persist_or_raise, #reply_to_parent, #root, #root_id, #set_variable, #tree, #tree_children, #try_persist, #try_unpersist, #unpersist_or_raise, #unset_variable, #update_tree, #variables, #wfid

Methods included from WithMeta

#class_def, included

Methods included from WithH

#h, #h=, included, #to_h

Constructor Details

This class inherits a constructor from Ruote::Exp::FlowExpression

Instance Method Details

#applyObject



51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/ruote/exp/fe_save.rb', line 51

def apply

  to_v, to_f = determine_tos

  if to_v
    set_variable(to_v, h.applied_workitem['fields'])
  elsif to_f
    set_f(to_f, Ruote.fulldup(h.applied_workitem['fields']))
  #else
    # do nothing
  end

  reply_to_parent(h.applied_workitem)
end

#reply(workitem) ⇒ Object



66
67
68
69
# File 'lib/ruote/exp/fe_save.rb', line 66

def reply(workitem)

  # empty, never called
end