lib/ru/fe_value.rb in openwferu-0.9.0 vs lib/ru/fe_value.rb in openwferu-0.9.1

- old
+ new

@@ -1,6 +1,7 @@ # +#-- # Copyright (c) 2006, 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: @@ -25,10 +26,11 @@ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # 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. +#++ # # $Id: definitions.rb 2725 2006-06-02 13:26:32Z jmettraux $ # # @@ -61,12 +63,11 @@ end child = @children[0] if child.kind_of? OpenWFE::FlowExpressionId - store_itself() - get_expression_pool().apply(child, workitem) + handle_child(child, workitem) return end workitem.attributes[FIELD_RESULT] = child.to_s @@ -93,23 +94,33 @@ reply_to_parent(workitem) end protected - def determine_value (workitem) + def handle_child (child, workitem) - if @children.length > 0 - child = @children[0] + child = get_expression_pool().fetch(child) - if child.kind_of? FlowExpressionId - return "nada" - else - return child - end + if child.is_definition? + fei = get_expression_pool().evaluate(child, workitem) + workitem.attributes[FIELD_RESULT] = fei + reply(workitem) + else + get_expression_pool().apply(child, workitem) end - - return OpenWFEru::lookup_value(self, workitem) end + + #def determine_value (workitem) + # if @children.length > 0 + # child = @children[0] + # if child.kind_of? FlowExpressionId + # return "nada" + # else + # return child + # end + # end + # return OpenWFEru::lookup_value(self, workitem) + #end end class UnsetValueExpression < FlowExpression def apply (workitem)