Class | OpenWFE::FqvExpression |
In: |
lib/openwfe/expressions/fe_fqv.rb
|
Parent: | FlowExpression |
This expression implementation gathers the ‘f’, ‘q’ and ‘v’ expressions, along with their fullname ‘field’, ‘variable’ and ‘quote’.
These expressions place the value of the corresponding, field, variable or quoted (direct value) in the ‘result’ field of the current workitem.
sequence do set :field => "f0", :value => "fox" set :variable => "v0", :value => "vixen" set :field => "f1" do v "v0" end set :variable => "v1" do f "f0" end set :variable => "v2" do f "f0" end end
Well, this is perhaps not the best example.
MAP | = | { "f" => :field, "q" => :quote, "v" => :variable |
apply / reply
# File lib/openwfe/expressions/fe_fqv.rb, line 84 84: def apply (workitem) 85: 86: name = @fei.expression_name[0, 1] 87: text = fetch_text_content(workitem) 88: 89: method = MAP[name] 90: 91: result = self.send(method, text, workitem) 92: 93: workitem.set_result(result) if result != nil 94: 95: reply_to_parent(workitem) 96: end
# File lib/openwfe/expressions/fe_fqv.rb, line 106 106: def field (text, workitem) 107: workitem.attributes[text] 108: end
# File lib/openwfe/expressions/fe_fqv.rb, line 110 110: def quote (text, workitem) 111: text 112: end