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

- old
+ new

@@ -28,12 +28,10 @@ # 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. #++ # -# $Id: definitions.rb 2725 2006-06-02 13:26:32Z jmettraux $ -# # # "made in Japan" # # John Mettraux at openwfe.org @@ -110,11 +108,11 @@ # if attname.is_a?(Array) conditional = lookup_attribute(attname, workitem) rconditional = lookup_attribute("r"+attname.to_s, workitem) - return do_eval(rconditional) \ + return do_eval(rconditional, workitem) \ if rconditional and not conditional return nil \ unless conditional @@ -123,20 +121,20 @@ conditional = from_xml conditional ldebug { "do_eval_condition() 1 for '#{conditional}'" } begin - return to_boolean(do_eval(conditional)) + return to_boolean(do_eval(conditional, workitem)) rescue Exception => e # probably needs some quoting... end conditional = do_quote(conditional) ldebug { "do_eval_condition() 2 for '#{conditional}'" } - to_boolean(do_eval(conditional)) + to_boolean(do_eval(conditional, workitem)) end private # @@ -193,11 +191,16 @@ # # Runs the given given within an instance_eval() at a $SAFE # level of 3. # - def do_eval (s) - OpenWFE::instance_eval_safely(self, s, 3) + def do_eval (s, workitem) + + #OpenWFE::instance_eval_safely(self, s, 3) + + wi = workitem + fe = self + OpenWFE::eval_safely(s, 3, binding()) end end end