NEW RELEASE! The 2022x Refresh2 Hot Fix 3 was released on February 28, 2025. For more information, see 2022x Refresh2 Hot Fix 3 Version News.

References to elements are similar to JavaScript Tool and Groovy Tool. The elements are implicitly inserted into the Ruby context when “eval()” or “execute()” is called. Examples of implicit variables include $Class, $UseCase, $sorter, etc.

For example, File ‘Functions.rb’:

def supplierList
result = [];
$Dependency.each do |item|
item.supplier.each do |supplier|
result << supplier;
end
end
return result;
end

Indicated below is the template code.

#import ('ruby', 'com.nomagic.reportwizard.tools.script.RubyScriptTool')
$ruby.execute('Functions.rb')
#set ($supplierList = $ruby.eval('supplierList'))
#foreach ($e in $supplierList)
$e.name
#end

Activity

All
Personal filters
All