4.0

Table Of Contents
5 Call the IPluginEventPublisher.pushGauge() or IPluginEventPublisher.pushTrigger() methods to
publish gauges or triggers to the Orchestrator policy engine.
The SolarSystemEventGenerator.generateFlareEvent() method calls the pushGauge() method to publish
a gauge with the Orchestrator policy engine. The generateFlareEvent() method passes the object type,
identifier, and magnitude value to the pushGauge() method, sets the gauge name to Flare and the type of
value that the gauge monitors to magnitude.
public void generateFlareEvent(String sdkType, String id, double magnitude) {
String key = sdkType + "' / '" + id;
log.info("Generate Flare Event for : '" + key + "'");
Vector<IPluginEventPublisher> publishers = policyElements.get(key);
if (publishers != null) {
for (IPluginEventPublisher publisher : publishers) {
publisher.pushGauge(sdkType, id, "Flare", "magnitude", magnitude);
}
}
6 Call the functions that define the events to generate and monitor.
To generate flare events, the SolarSystemEventGenerator.generateFlareEvent() method calls the
StarFlareEventListener.starFlareEvent() method that the SolarSystemEventGenerator class defines.
public void generateFlareEvent(String sdkType, String id, double magnitude) {
String key = sdkType + "' / '" + id;
log.info("Generate Flare Event for : '" + key + "'");
Vector<IPluginEventPublisher> publishers = policyElements.get(key);
if (publishers != null) {
for (IPluginEventPublisher publisher : publishers) {
publisher.pushGauge(sdkType, id, "Flare", "magnitude", magnitude);
}
if (sdkType.equals("Star")) {
starFlareEventListener.starFlareEvent(id, magnitude);
}
}
You registered a policy gauge or a trigger that an Orchestrator policy can watch for events in the plugged-in
technology. If the events occur, the policy starts an operation in the Orchestrator server.
What to do next
Create plug-in triggers to start operations in the Orchestrator server when certain events occur in the plugged-
in technology.
Create a Plug-In Workflow Trigger
You can create plug-in workflow triggers to monitor events in the plugged-in technology on behalf of a Wait
Event element in a workflow. To create a workflow trigger, you create a Java class that implements the
PluginTrigger class from the Orchestrator plug-in API.
When a workflow trigger detects a change in the properties of an object that it is monitoring, it sends a
notification to any Orchestrator workflows that are waiting for the event. When the workflow receives the
notification from the workflow trigger, it stops waiting and resumes its run.
The PluginTrigger class defines methods to obtain or set the type and name of the object to monitor, the nature
of the event, and a timeout period.
You create implementations of the PluginTrigger class exclusively for use by Wait Event elements in
workflows. You define policy triggers for Orchestrator policies in classes that define events and implement
the IPluginEventPublisher.pushTrigger() method.
Chapter 7 Developing Plug-Ins
VMware, Inc. 175