4.0

Table Of Contents
Prerequisites
You must have set up the plug-in, and defined <finder> elements and enumerations.
Procedure
1 Map a Java class from the plugged-in technology or from the plug-in implementation to a JavaScript class.
The SolarSystemEventGenerator class defines the events that Orchestrator can invoke in the solar system
application. The solar system vso.xml file maps the event generator class to a JavaScript class named
_SolarSystemEventGenerator. By setting the strict attribute to true, Orchestrator can only call the
methods from the SolarSystemEventGenerator class that are mapped in the vso.xml file. To allow scripting
to instantiate a class you use the create attribute.
<scripting-objects>
<object script-name="_SolarSystemEventGenerator"
java-class="com.vmware.orchestrator.api.sample.solarsystem.SolarSystemEventGenerator"
strict="true">
<description>The entry point to generate events</description>
[...]
</object>
[...]
</scripting-objects>
2 (Optional) If necessary, denote the JavaScript object as a singleton object.
In the solar system example, SolarSystemEventGenerator is a singleton object. The plug-in adaptor can
only create a single instance of the SolarSystemEventGenerator class. You can only call the methods of the
SolarSystemEventGenerator JavaScript object and cannot instantiate the class in Orchestrator scripts.
<singleton script-name="SolarSystemEventGenerator"
datasource="solar-datasource"/>
Chapter 7 Developing Plug-Ins
VMware, Inc. 207