lib/openwfe/worklist/storeparticipant.rb in openwferu-0.9.3 vs lib/openwfe/worklist/storeparticipant.rb in openwferu-0.9.4

- old
+ new

@@ -33,13 +33,14 @@ # # # "made in Japan" # -# Alain Hoang at openwfe.org +# John Mettraux at openwfe.org # +require 'openwfe/storage/yamlfilestorage' require 'openwfe/participants/participant' module OpenWFE @@ -117,18 +118,20 @@ # 'proceed' is just an alias for 'forward' # alias :proceed :forward # - # Returns all the workitems for a given workflow isntance id. + # Returns all the workitems for a given workflow instance id. + # If no workflow_instance_id is given, all the workitems will be + # returned. # - def list_workitems (workflow_instance_id) + def list_workitems (workflow_instance_id=nil) result = [] self.each_value do |workitem| result << workitem \ - if workitem.fei.parent_wfid == workflow_instance_id + if (not workflow_instance_id) or workitem.fei.parent_wfid == workflow_instance_id end result end end @@ -139,7 +142,19 @@ # class HashParticipant < Hash include StoreParticipantMixin # that's all... + end + + # + # TODO : finish me + # + class YamlParticipant < YamlFileStorage + include StoreParticipantMixin + + def initialize + workpath = application_context[:work_directory] + "/participants" + super(service_name, application_context, workpath) + end end end