Page History
References to elements are similar to ones in JavaScript Tool. The elements are implicitly inserted into the Groovy context when calling “eval()”, or “execute()”. Examples of implicit variables include $Class, $UseCase, $sorter, etc.
File 'AllAbstractClass.groovy'
Code Block | ||
---|---|---|
| ||
// variable $Class can be accessed directly inside Groovy script
def list = []
for (c in $Class) {
if (c.isAbstract()) {
list.add(c)
}
}
return list |
The report template code is:
Code Block | ||
---|---|---|
| ||
#import ('groovy', 'com.nomagic.reportwizard.tools.script.GroovyTool')
#set ($abstractClassList = $groovy.execute('AllAbstractClass.groovy'))
#foreach ($cls in $abstractClassList)
$cls.name
#end |
...