Class OpenWFE::YamlParticipant
In: lib/openwfe/worklist/storeparticipant.rb
Parent: YamlFileStorage

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)

Methods

Included Modules

StoreParticipantMixin

Attributes

dirname  [RW] 

Public Class methods

The constructor for YamlParticipant awaits a dirname and an application_context. The dirname should be a simple name acceptable as a filename.

[Source]

     # File lib/openwfe/worklist/storeparticipant.rb, line 232
232:         def initialize (dirname, application_context)
233: 
234:             @dirname = OpenWFE::ensure_for_filename(dirname.to_s)
235: 
236:             service_name = self.class.name + "__" + @dirname
237: 
238:             path = "/participants/" + @dirname
239: 
240:             super(service_name, application_context, path)
241:         end

Protected Instance methods

[Source]

     # File lib/openwfe/worklist/storeparticipant.rb, line 245
245:             def compute_file_path (fei)
246: 
247:                 @basepath +
248:                 fei.workflow_instance_id + "__" +
249:                 fei.workflow_definition_name + "_" +
250:                 fei.workflow_definition_revision + "__" +
251:                 fei.expression_id + ".yaml"
252:             end

[Validate]