Class OpenWFE::PrintExpression
In: lib/openwfe/expressions/fe_misc.rb
Parent: FlowExpression

A debug/test expression (it‘s mostly used in the test suite used for the development of OpenWFEru). Outputs a message to the STDOUT (via the "puts" Ruby method).

    <print>hello</print>

    _print "hello"
    _print do
        "in a block"
    end

Note that when expressing the process in Ruby, an underscore has to be placed in front of the expression name to avoid a collision with the Ruby ‘print’ function.

If there is an object bound in the application context under the name ‘__tracer’, this expression will append its message to this instance instead of emitting to the STDOUT. (this is how the OpenWFEru test suite uses this expression).

Methods

reply  

Included Modules

ValueMixin

Public Instance methods

[Source]

    # File lib/openwfe/expressions/fe_misc.rb, line 73
73:         def reply (workitem)
74: 
75:             text = workitem.get_result.to_s
76:             text << "\n"
77: 
78:             tracer = @application_context['__tracer']
79: 
80:             if tracer
81:                 tracer << text
82:             else
83:                 puts text
84:             end
85: 
86:             reply_to_parent workitem
87:         end

[Validate]