Module Ruote::ReceiverMixin
In: lib/ruote/receiver/base.rb

The core methods for the Receiver class (sometimes a Mixin is easier to integrate).

(The engine itself includes this mixin, the LocalParticipant module includes it as well).

Methods

Public Instance methods

Given a process definitions and optional initial fields and variables, launches a new process instance.

This method is mostly used from the Ruote::Engine class (which includes this mixin).

process_definition must be a result of Ruote.process_definition call or XML or JSON serialized process definition, as accepted by Ruote::Parser#parse.

fields are workflow parameters that will be placed in workitem.fields.

variables contain engine variables.

This method pipes back a workitem into the engine, letting it resume in its flow, hopefully.

Wraps a call to receive(workitem)

Not aliasing so that if someone changes the receive implementation, reply is affected as well.

Wraps a call to receive(workitem)

Not aliasing so that if someone changes the receive implementation, reply_to_engine is affected as well.

A receiver signs a workitem when it comes back.

Not used much as of now.

Protected Instance methods

Convenience method, fetches the flow expression (ParticipantExpression) that emitted that workitem.

Fetches back a stashed value.

  get(fei, 'colour')
    # => 'blue'

To return the whole stash

  get(fei)
    # => { 'colour' => 'blue' }

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

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 groups.google.com/group/openwferu-users/t/2e6a95708c10847b for the justification.

[Validate]