Class | Ruote::Exp::RestoreExpression |
In: |
lib/ruote/exp/fe_restore.rb
|
Parent: | FlowExpression |
Restores the fields of the current workitem. That means usually copying them from a saved version in a variable or in a separate field.
restore :from_var => 'v'
or
restore :from_f => 'customer.address.street', :to_f => 'delivery.street'
(yes, this sets the field ‘street’ inside of the field ‘delivery’)
This expressions has a ‘set_fields’ alias. It can be handy (and readable) to set a bunch of workitem fields in one sweep somewhere in a process :
Ruote.process_definition :name => 'working hard' do sequence do set_fields :val => { 'customer' => { 'name' => 'Fred', 'age' => 40 } } participant :ref => 'delivery' participant :ref => 'invoincing' end end