def apply
h.participant_name = (attribute(:ref) || attribute_text).to_s
raise ArgumentError.new(
"no participant name specified"
) if h.participant_name == ''
participant_info =
h.participant ||
@context.plist.lookup_info(h.participant_name, h.applied_workitem)
unless participant_info.respond_to?(:consume)
h.participant = participant_info
end
raise(ArgumentError.new(
"no participant named #{h.participant_name.inspect}")
) if participant_info.nil?
schedule_timeout(participant_info)
h.applied_workitem['participant_name'] = h.participant_name
h.applied_workitem['fields']['params'] = compile_atts
persist_or_raise
@context.storage.put_msg(
'dispatch',
'fei' => h.fei,
'participant_name' => h.participant_name,
'participant' => h.participant,
'workitem' => h.applied_workitem,
'for_engine_worker?' => (participant_info.class != Array))
end