lib/openwfe/expressions/fe_when.rb in openwferu-0.9.16 vs lib/openwfe/expressions/fe_when.rb in openwferu-0.9.17
- old
+ new
@@ -1,8 +1,8 @@
#
#--
-# Copyright (c) 2006-2007, John Mettraux, OpenWFE.org
+# Copyright (c) 2006-2008, John Mettraux, OpenWFE.org
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
@@ -36,12 +36,10 @@
#
# John Mettraux at openwfe.org
#
require 'openwfe/utils'
-require 'openwfe/util/otime'
-require 'openwfe/util/scheduler'
require 'openwfe/expressions/time'
require 'openwfe/expressions/timeout'
require 'openwfe/expressions/condition'
@@ -100,18 +98,14 @@
attr_accessor \
:consequence_triggered,
:condition_sub_id
- DEFAULT_FREQUENCY = "10s"
-
def apply (workitem)
- if @children.size < 1
- reply_to_parent workitem
- return
- end
+ return reply_to_parent(workitem) \
+ if @children.size < 1
@condition_sub_id = -1
@consequence_triggered = false
super workitem
@@ -121,29 +115,27 @@
#ldebug do
# "reply() @consequence_triggered is '#{@consequence_triggered}'"
#end
- if @consequence_triggered
- reply_to_parent(workitem)
- return
- end
+ return reply_to_parent(workitem) \
+ if @consequence_triggered
super workitem
end
protected
def apply_consequence (workitem)
@consequence_triggered = true
- store_itself()
+ store_itself
i = 1
i = 0 if @children.size == 1
- get_expression_pool.apply(@children[i], workitem)
+ get_expression_pool.apply @children[i], workitem
end
end
end