
Tutorial 6: Creating a Form 127
Creating the Tasks and Forms
Context Inputs
Configuration
Groovy Script def hostId = @contextIn["hostId"]; def newAnnotation =
@contextIn["newAnnotation"]; topSrv = server.get("TopologyService"); tempO =
topSrv.getObject(hostId); tempO = topSrv.beginUpdate(tempO); hostAnnotations
= tempO.get("annotations"); hostAnnotations.clear();
hostAnnotations.add(newAnnotation); tempO= topSrv.endUpdate(tempO);
Flow
• Action Base exit
• Flow type Previous
• Update True
• Additional Context
• Action An Error Occurred
• Flow type Update
The Groovy Scripts
The scripts are repeated here in a more readable format. You can use them to paste into
the script configuration field of the Execute Groovy Script task component. These
scripts call vFoglight and Java methods to do the work. A handy way to access the API
for vFoglight is through the browser interface. Under Dashboards in the navigation
panel, choose Administration > Tooling > Script Editor. In the Query and Scripting
Service Tool, click the icon for Script Help ( ), which is at the top right of the Script
box. Alternatively, you can type help(server) and click the Run button below the Script
box. In the Result area, click Topology Service to see the vFoglight methods used in
this tutorial.
Key Usage Data Source Type Data Type Default
Value
newAnnotation Optional Common String
hostId Optional Common String
Key Value
newAnnotation Context Selection <newAnnotation> returning
“Localized Value”
Kommentare zu diesen Handbüchern