lib/openwfe/expool/yamlexpstorage.rb in openwferu-0.9.3 vs lib/openwfe/expool/yamlexpstorage.rb in openwferu-0.9.4
- old
+ new
@@ -60,20 +60,31 @@
#
# reopening some classes in order to facilitate their
# yaml serialization
#
+ #
# opening for tuning yaml persistence
#
class FlowExpression
+
def to_yaml_properties
+
l = super()
+
l.delete("@application_context")
+
+ l.delete("@timeout_job_id")
+ l.delete("@scheduler_job_id")
+ #
+ # scheduler ids should not get persisted
+
return l
end
end
+ #
# opening for tuning yaml persistence
#
class XmlRawExpression
def to_yaml_properties
l = super()
@@ -87,16 +98,19 @@
#
class YamlFileExpressionStorage < YamlFileStorage
include OwfeServiceLocator
def initialize (service_name, application_context)
+
path = if (@application_context)
- @application_context[:file_expression_storage_path]
+ @application_context[:work_directory]
else
- DEFAULT_FILE_STORAGE_PATH
+ DEFAULT_WORK_DIRECTORY
end
- super(service_name, application_context, path + "/expool")
+ path = path + '/expool'
+
+ super(service_name, application_context, path)
end
#
# Iterates on each expression that is of the given kind.
# Used for example by the expression pool when rescheduling.
@@ -121,13 +135,14 @@
block.call expression
end
end
def to_s
+
s = "\n\n==== #{self.class} ===="
s << "\n"
- each_expression_path do |path|
+ each_object_path do |path|
s << path
s << "\n"
end
s << "==== . ====\n"
return s
@@ -150,13 +165,15 @@
fei.expression_id + "_" +
fei.expression_name + ".yaml"
end
def matches (path, exp_names)
+
exp_names.each do |exp_name|
return true \
if OpenWFE::ends_with(path, "_#{exp_name}.yaml")
end
+
return false
end
end
end