lib/openwfe/expressions/fe_participant.rb in openwferu-0.9.9 vs lib/openwfe/expressions/fe_participant.rb in openwferu-0.9.10
- old
+ new
@@ -55,13 +55,44 @@
# Participants sit at the edge between the engine and the external
# world. The participant expression transmit the workitem applied
# to it to the Participant instance it looks up in the participant map
# tied to the engine.
#
+ # <participant ref="alpha" />
+ # <!-- direct reference to participant alpha -->
+ #
+ # <participant field-ref="target" />
+ # <participant ref="${f:target}" />
+ # <!-- the name of the participant is the value found in
+ # the field 'target' -->
+ #
+ # <participant variable-ref="target" />
+ # <participant ref="${target}" />
+ # <!-- the name of the participant is the value found in
+ # the variable 'target' -->
+ #
+ # <alpha />
+ # <!-- direct reference to participant 'alpha'
+ # if a subprocess named 'alpha' has been defined, the
+ # subprocess will be called instead -->
+ #
# The Participant expressions includes the FilterMixin and thus
# understands and applies the "filter" attribute.
#
+ # Since OpenWFE 0.9.9, the attributes of the participant expression are
+ # set inside a hash field named 'params' just available to the participant.
+ # Thus in
+ #
+ # <participant ref="toto" task="play golf" location="Minami Center" />
+ #
+ # participant 'toto' will receive a workitem with a field named 'params'
+ # containing the hash
+ # { "ref"=>"toto", "task"=>"play golf", "location"=>"Minami Center" }.
+ #
+ # When the workitem gets back from the participant, the field 'params' is
+ # deleted.
+ #
class ParticipantExpression < FlowExpression
include FilterMixin
include TimeoutMixin
names :participant
@@ -89,10 +120,10 @@
store_itself()
workitem.params = lookup_attributes workitem
- get_participant_map.dispatch(@participant_name, workitem)
+ get_participant_map.dispatch @participant_name, workitem
end
def reply_to_parent (workitem)
unschedule_timeout()