def stash_put(workitem_or_fei, key, value=nil)

      hash = key.is_a?(Hash) ? key : { key => value }

      exp = fetch_flow_expression(workitem_or_fei)

      (exp.h['stash'] ||= {}).merge!(hash)

      r = exp.try_persist

      return hash if r == nil
      return stash_put(workitem_or_fei, key, value) if r != true

      fei = Ruote::FlowExpressionId.extract(workitem_or_fei).sid rescue 'xxx'
      raise ArgumentError.new("failed to put, expression #{fei} is gone")
    end
def stash_put(workitem_or_fei, key, value=nil)

      hash = key.is_a?(Hash) ? key : { key => value }

      exp = fetch_flow_expression(workitem_or_fei)

      (exp.h['stash'] ||= {}).merge!(hash)

      r = exp.try_persist

      return hash if r == nil
      return stash_put(workitem_or_fei, key, value) if r != true

      fei = Ruote::FlowExpressionId.extract(workitem_or_fei).sid rescue 'xxx'
      raise ArgumentError.new("failed to put, expression #{fei} is gone")
    end
Stashes values in the participant expression (in the storage).

   put(workitem.fei, 'key' => 'value', 'colour' => 'blue')

 Remember that keys/values must be serializable in JSON.

 put & get are useful for a participant that needs to communicate
 between its consume and its cancel.

 See the thread at
 http://groups.google.com/group/openwferu-users/t/2e6a95708c10847b for the
 justification.