Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
languagetext
// 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
languagetext
#import ('groovy', 'com.nomagic.reportwizard.tools.script.GroovyTool')
#set ($abstractClassList = $groovy.execute('AllAbstractClass.groovy'))
#foreach ($cls in $abstractClassList)
$cls.name
#end

...