4.0

Table Of Contents
4 Call the Properties.setProperty() method to add the properties to monitor to the properties list.
The SolarSystemTriggerGenerator class adds the identifier of the star object and the value of the
magnitude of the solar flare event to the properties list props.
public PluginTrigger createStarFlareTrigger(Star star, double magnitude){
PluginTrigger trigger = newTrigger();
Properties props = new Properties();
props.setProperty(STAR_ID, star.getId());
props.setProperty(MAGNITUDE, Double.toString(magnitude));
return trigger;
}
5 Call the PluginTrigger.setProperties() method to add the properties list to the workflow trigger
instance.
The SolarSystemTriggerGenerator class adds the properties list props to the workflow trigger, to provide
the identifier of the star object and the value of the flare event to monitor.
public PluginTrigger createStarFlareTrigger(Star star, double magnitude){
PluginTrigger trigger = newTrigger();
Properties props = new Properties();
props.setProperty(STAR_ID, star.getId() );
props.setProperty(MAGNITUDE, Double.toString(magnitude));
trigger.setProperties( props );
return trigger;
}
You added a list of properties to a workflow trigger so that it can monitor the value of a given property in an
object. If the properties of the object change, the workflow trigger notifies any workflows that are waiting for
that event.
What to do next
Create plug-in watchers to watch the triggers for events.
Create Plug-In Watchers
Plug-in watchers watch triggers on behalf of workflows that are waiting for the event that the trigger starts.
To create a plug-in watcher, you create a Java class that implements the PluginWatcher class from the
Orchestrator plug-in API. You publish the watcher on the Orchestrator notification server by implementing
the IPluginPublisher interface.
These procedures present the steps involved in creating a plug-in watcher. To illustrate the process, they
present code from the SolarSystemWatchersManager class from the solar system plug-in.
You can download the Orchestrator examples ZIP file from the Orchestrator documentation home page to
obtain the sources of the solar system example application and plug-in.
For a description of the role of plug-in event watchers and the other components of a plug-in, see “Overview
of Plug-Ins,” on page 141. For information about all of the methods and parameters of the plug-in watcher
class and publisher interface, see “PluginWatcher Class,” on page 223 and “IPluginPublisher Interface,” on
page 220.
Procedure
1 Set Up the Watcher Implementation on page 180
You can create PluginWatcher instances and methods to generate events directly in the plug-in adaptor.
However, the solar system example creates the watcher instances in a separate class named
SolarSystemWatchersManager.
Chapter 7 Developing Plug-Ins
VMware, Inc. 179