10.5.  Producing Results with Groovy Scripts

Press the "Run" button to run a Groovy script manually. The combo box allows to change the Run Configuration to be used.

After a script was executed, the results of the scripts appear in five different tabs. The tabs that really hold results are marked with an exclamation mark. The class ResultAccess (see JavaDoc) provides methods to add different types of results.

The "Elements" and "Dependencies" tab hold a list of elements/dependencies, which were added by the script with

 result.addElement()

Script View Elements Tab
Figure 10.10. Script View Elements Tab

The "Tree" tab holds structure of nodes, which were added by the script with

result.addNode()

A node can have child nodes, or child elements.

Script View Tree Tab
Figure 10.11. Script View Tree Tab

The "Issues Preview" tab shows a list of issues, which were added by the script with one of

 result.addInfoIssue()

 result.addWarningIssue()

 result.addErrorIssue()

Script View Issues Preview
Figure 10.12. Script View Issues Preview

The "Metrics Preview" tab shows a list of metrics, which were added by the script with

MetricIdAccess id = coreAccess.getOrCreateMetricId(
    "SupertypeUsesSubtype",
    "Supertype uses subtype",
    "A super type must not know its subtypes",
    false /*non-float*/);
result.addMetricValue(id, coreAccess, warnings)

Script View Metrics Preview
Figure 10.13. Script View Metrics Preview