lib/openwfe/expressions/fe_fqv.rb in openwferu-0.9.7 vs lib/openwfe/expressions/fe_fqv.rb in openwferu-0.9.8
- old
+ new
@@ -47,35 +47,53 @@
#
module OpenWFE
#
- # The 'cursor' is much like a sequence, but you can go
- # back and forth within it.
+ # 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.
+ #
class FqvExpression < FlowExpression
names :f, :q, :v, :field, :quote, :variable
#
# apply / reply
def apply (workitem)
name = @fei.expression_name[0, 1]
- text = OpenWFE::fetch_text_content(self, workitem)
+ text = fetch_text_content(workitem)
method = MAP[name]
result = self.send(method, text, workitem)
- OpenWFE::set_result(workitem, result) if result != nil
+ workitem.set_result(result) if result != nil
reply_to_parent(workitem)
end
-
- #def reply (workitem)
- #end
protected
MAP = {
"f" => :field,