| Class | Ruote::Workitem |
| In: |
lib/ruote/workitem.rb
|
| Parent: | Object |
A workitem can be thought of an "execution token", but with a payload (fields).
The payload/fields MUST be JSONifiable.
| h | [R] |
For a simple key
workitem.lookup('toto')
is equivalent to
workitem.fields['toto']
but for a complex key
workitem.lookup('toto.address')
is equivalent to
workitem.fields['toto']['address']
Shortcut for wi.fields[‘params’]
When a participant is invoked like in
participant :ref => 'toto', :task => 'x"
then
p workitem.params
# => { 'ref' => 'toto', 'task' => 'x' }
The participant for which this item is destined. Will be nil when the workitem is transiting inside of its process instance (as opposed to when it‘s being delivered outside of the engine).
A shortcut to the value in the field named result
This field is used by the if expression for instance to determine if it should branch to its ‘then’ or its ‘else’.
Like lookup allows for nested lookups, set_field can be used to set sub fields directly.
workitem.set_field('customer.address.city', 'Pleasantville')
Warning : if the customer and address field and subfield are not present or are not hashes, set_field will simply create a "customer.address.city" field and set its value to "Pleasantville".
Returns the String id for this workitem (something like "0_0!!20100507-wagamama").
It‘s in fact a shortcut for
Ruote::FlowExpressionId.to_storage_id(h.fei)