Class: OpenWFE::YamlParticipant
- Inherits:
-
YamlFileStorage
- Object
- YamlFileStorage
- OpenWFE::YamlParticipant
- Includes:
- StoreParticipantMixin
- Defined in:
- lib/openwfe/worklist/storeparticipant.rb
Overview
Implementation of a store participant stores the workitems in yaml file in a dedicated directory.
It’s quite easy to register a YamlParticipant :
yp = engine.register_participant(:alex, YamlParticipant)
puts yp.dirname
should yield “./work/participants/alex/” (if the key :work_directory in engine.application_context is unset)
Instance Attribute Summary collapse
-
#dirname ⇒ Object
Returns the value of attribute dirname.
Attributes included from StoreParticipantMixin
Attributes included from Contextual
Attributes inherited from YamlFileStorage
Attributes included from ServiceMixin
Instance Method Summary collapse
-
#initialize(dirname, application_context) ⇒ YamlParticipant
constructor
The constructor for YamlParticipant awaits a dirname and an application_context.
Methods included from StoreParticipantMixin
#cancel, #consume, #delegate, #delete, #first_workitem, #forward, #list_workitems, #save
Methods included from LocalParticipant
#call_block, #get_flow_expression, #reply_to_engine
Methods included from Participant
Methods included from Contextual
#get_work_directory, #init_service, #lookup
Methods included from Logging
#ldebug, #ldebug_callstack, #lerror, #lfatal, #linfo, #llog, #lunknown, #lwarn
Methods included from OwfeServiceLocator
#get_engine, #get_error_journal, #get_expool, #get_expression_map, #get_expression_pool, #get_expression_storage, #get_expression_storages, #get_journal, #get_participant_map, #get_scheduler, #get_wfid_generator
Methods inherited from YamlFileStorage
#[], #[]=, #delete, #has_key?, #length, #purge
Methods included from ServiceMixin
Constructor Details
#initialize(dirname, application_context) ⇒ YamlParticipant
The constructor for YamlParticipant awaits a dirname and an application_context. The dirname should be a simple name acceptable as a filename.
232 233 234 235 236 237 238 239 240 241 |
# File 'lib/openwfe/worklist/storeparticipant.rb', line 232 def initialize (dirname, application_context) @dirname = OpenWFE::ensure_for_filename(dirname.to_s) service_name = self.class.name + "__" + @dirname path = "/participants/" + @dirname super(service_name, application_context, path) end |
Instance Attribute Details
#dirname ⇒ Object
Returns the value of attribute dirname.
225 226 227 |
# File 'lib/openwfe/worklist/storeparticipant.rb', line 225 def dirname @dirname end |