block_participant

One of the simplest participants. Simply passes a workitem to a block
of ruby code.

              engine.register_participant :alpha do |workitem|
                workitem.fields['time'] = Time.now
              end
            

This participant implicitely replies to the engine when the block execution
is over.

You can pass the flow_expression (participant expression) as well.

              engine.register_participant :alpha do |workitem, flow_exp|
                workitem.fields['amount'] = flow_exp.lookup_variable('amount')
              end
            
            

do_not_thread

By default, this participant (like most other participants) is executed
in its own thread.

context

As it includes Ruote::LocalParticipant, the block partitcipant has
access to:

  • #context: the ruote context
  • #workitem: the current workitem (usually passed as arg to the block)
  • #fei: the current flow expression id
  • #fexp: the current flow expression
  • #flavour: only used in #on_cancel (nil or ‘kill’)
  • #lookup_variable(key): looks up a variable…