Module OpenWFE::LocalParticipant
In: lib/openwfe/participants/participant.rb

Local participants provide handy methods like reply_to_engine() to further implementations of the Participant concept.

Methods

Included Modules

Participant Contextual Logging OwfeServiceLocator

Public Instance methods

A convenience method for calling block passed to participants for templates (mail participants) or execution (BlockParticipant).

Allows for such blocks :

    { |workitem| ... }
    { |participant_expression, workitem| ... }
    { |participant_expression, participant, workitem| ... }

For 0 or more than 3 arguments, the block will be called without arguments.

[Source]

     # File lib/openwfe/participants/participant.rb, line 117
117:         def call_block (block, workitem)
118: 
119:             if block.arity == 1
120:                 block.call workitem
121:             elsif block.arity == 2
122:                 block.call get_flow_expression(workitem), workitem
123:             elsif block.arity == 3
124:                 block.call get_flow_expression(workitem), self, workitem
125:             else
126:                 block.call
127:             end
128:         end

Returns the FlowExpression instance that triggered this participant. A ParticipantExpression instance will most likely be returned.

[Source]

     # File lib/openwfe/participants/participant.rb, line 97
 97:         def get_flow_expression (workitem)
 98: 
 99:             return nil if not @application_context
100: 
101:             get_expression_pool.fetch_expression(workitem.flow_expression_id)
102:         end

Participants use this method to reply to their engine when their job is done.

[Source]

     # File lib/openwfe/participants/participant.rb, line 134
134:         def reply_to_engine (workitem)
135: 
136:             get_engine.reply(workitem)
137:         end

[Validate]