4.1

Table Of Contents
n
Create PluginTrigger instances.
Procedure
1 Declare variables for the object and object properties that the workflow trigger monitors.
The SolarSystemTriggerGenerator class declares variables for the Star object that it monitors and for the
magnitude of any solar flare events that occur on that star.
public static final String STAR_ID = "star_id";
public static final String MAGNITUDE = "magnitude";
2 Create an instance of the PluginTrigger class in which to set the properties to monitor.
The SolarSystemTriggerGenerator class calls the SolarSystemTriggerGenerator.newTrigger() method to
create a trigger instance.
public PluginTrigger createStarFlareTrigger(Star star, double magnitude) {
PluginTrigger trigger = newTrigger();
return trigger;
}
3 Create an instance of a java.util.Properties list to contain the properties to monitor.
The SolarSystemTriggerGenerator class create a properties list named props.
public PluginTrigger createStarFlareTrigger(Star star, double magnitude){
PluginTrigger trigger = newTrigger();
Properties props = new Properties();
return trigger;
}
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.
vCenter Orchestrator Developer's Guide
174 VMware, Inc.