lib/openwfe/expressions/environment.rb in openwferu-0.9.13 vs lib/openwfe/expressions/environment.rb in openwferu-0.9.14

- old
+ new

@@ -27,10 +27,11 @@ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. #++ +# # # "made in Japan" # # John Mettraux at openwfe.org @@ -98,10 +99,12 @@ # Removes a variable from this environment. # def delete (key) synchronize do + ldebug { "#{fei.to_debug_s} delete() '#{key}'" } + @variables.delete key store_itself() end end @@ -111,33 +114,40 @@ # It takes care of removing subprocess templates pointed at by # variables in this environment. # def unbind () + #ldebug { "unbind() for #{fei.to_s}" } + @variables.each do |key, value| #ldebug { "unbind() '#{key}' => #{value.class}" } if value.kind_of? FlowExpressionId + get_expression_pool().remove(value) + elsif value.kind_of? FlowExpression + value.cancel end end end # # Returns true if this environment is the engine environment # def is_engine_environment? - return @fei == get_expression_pool().engine_environment_id + + (@fei == get_expression_pool().engine_environment_id) end # # Should never get used, only the reschedule() method is relevant # for the Schedulable aspect of an environment expression. # def trigger (params) + raise "an environment should never get directly triggered" end # # Will reschedule any 'Schedulable' variable found in this environment