lib/openwfe/expressions/flowexpression.rb in openwferu-0.9.4 vs lib/openwfe/expressions/flowexpression.rb in openwferu-0.9.5
- old
+ new
@@ -160,11 +160,11 @@
# simply if the expression got swapped out of memory and reloaded later.
#
def store_itself ()
ldebug { "store_itself() for #{@fei.to_debug_s}" }
#ldebug { "store_itself() \n#{OpenWFE::caller_to_s(0, 6)}" }
- get_expression_pool().update(self)
+ return get_expression_pool().update(self)
end
#
# Returns the environment instance this expression uses.
# An environment is a container (a scope) for variables in the process
@@ -220,11 +220,11 @@
#
# The variable name may be prefixed by / to indicate process level scope
# or by // to indicate engine level (global) scope.
#
def lookup_variable (varname)
- return get_environment()[varname]
+ get_environment()[varname]
end
#
# Unsets a variable in the current environment.
#
@@ -305,10 +305,25 @@
end
return result
end
+ #
+ # For an expression like
+ #
+ # iterator :on_value => "a, b, c", to-variable => "v0" do
+ # # ...
+ # end
+ #
+ # this call
+ #
+ # lookup_comma_list_attribute(:on_value, wi)
+ #
+ # will return
+ #
+ # [ 'a', 'b', 'c' ]
+ #
def lookup_comma_list_attribute (attname, workitem, default=nil)
a = lookup_attribute(attname, workitem, default)
return nil if not a
@@ -342,11 +357,11 @@
env = Environment\
.new(@environment_id, parent_fei, nil, @application_context, nil)
ldebug { "new_environment() is #{env.fei.to_debug_s}" }
- env.store_itself()
+ return env.store_itself()
end
#
# Takes care of removing all the children of this expression, if any.
#
@@ -375,13 +390,17 @@
# monitors that is used. But the synchronize code looks like the class
# just included the MonitorMixin. No hassle.
#
def synchronize
+ #ldebug { "synchronize() ---in--- for #{@fei.to_debug_s}" }
+
get_expression_pool.get_monitor(@fei).synchronize do
yield
end
+
+ #ldebug { "synchronize() --out-- for #{@fei.to_debug_s}" }
end
#
# Some eye candy
#
@@ -416,28 +435,9 @@
def symbol_to_attname (s)
attname = s.to_s
attname = OpenWFE::to_dash(attname)
return attname
end
- end
-
- #
- # A parent class for CursorExpression and IteratorExpression.
- # Takes care of removing templates before replying to the parent
- # expression.
- #
- class WithTemplateExpression < FlowExpression
-
- #
- # this overriden method takes care of removing all the children
- # (templates) before replying to its parent.
- #
- def reply_to_parent (workitem)
- @children.each do |child|
- get_expression_pool.remove(child)
- end
- super(workitem)
- end
end
end