Template rendering helper.
(Currently only used by the SmtpParticipant, could prove useful for custom participants)
Simply returns a pretty-printed view of the workitem
# File lib/ruote/part/template.rb, line 53 def render_default_template (workitem) workitem = workitem.to_h if workitem.respond_to?(:to_h) s = [] s << "workitem for #{workitem['participant_name']}" s << '' s << Rufus::Json.encode(workitem['fei']) s << '' workitem['fields'].keys.sort.each do |key| s << " - '#{key}' ==> #{Rufus::Json.encode(workitem['fields'][key])}" end s.join("\n") end
# File lib/ruote/part/template.rb, line 39 def render_template (template, flow_expression, workitem) template = (File.read(template) rescue nil) if is_a_file?(template) return render_default_template(workitem) unless template template = template.to_s workitem = workitem.to_h if workitem.respond_to?(:to_h) Ruote.dosub(template, flow_expression, workitem) end
Generated with the Darkfish Rdoc Generator 2.