Class: Ruote::Exp::SaveExpression
- Inherits:
-
FlowExpression
- Object
- FlowExpression
- Ruote::Exp::SaveExpression
- 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'
#
# 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).
Constant Summary
Constant Summary
Constants inherited from FlowExpression
FlowExpression::COMMON_ATT_KEYS
Instance Attribute Summary
Attributes inherited from FlowExpression
Instance Method Summary (collapse)
Methods inherited from FlowExpression
#ancestor?, #att, #attribute, #attribute_text, #attributes, #cancel, #compile_atts, #compile_variables, do_action, #do_apply, #do_cancel, #do_fail, #do_persist, #do_reply, #do_unpersist, #expand_atts, #fei, fetch, from_h, #handle_on_error, #has_attribute, #initial_persist, #initialize, #iterative_var_lookup, #launch_sub, #lookup_on_error, #lookup_val, #lookup_val_prefix, #lookup_variable, #name, names, #parent, #parent_id, #persist_or_raise, #reply_to_parent, #set_variable, #to_h, #tree, #tree_children, #try_persist, #try_unpersist, #unpersist_or_raise, #unset_variable, #update_tree, #variables
Methods included from WithMeta
Methods included from WithH
Constructor Details
This class inherits a constructor from Ruote::Exp::FlowExpression
Instance Method Details
- (Object) apply
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/ruote/exp/fe_save.rb', line 48 def apply tk = has_attribute(*%w[ v var variable ].map { |k| "to_#{k}" }) || has_attribute(*%w[ 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 |
- (Object) reply(workitem)
73 74 75 76 |
# File 'lib/ruote/exp/fe_save.rb', line 73 def reply(workitem) # empty, never called end |