4.1

Table Of Contents
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 139. For information about all of the methods and parameters of the plug-in watcher
class and publisher interface, see “PluginWatcher Class,” on page 217 and “IPluginPublisher Interface,” on
page 213.
Procedure
1 Set Up the Watcher Implementation on page 175
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.
2 Create Instances of the PluginWatcher Class on page 177
You create a plug-in watcher to watch a workflow trigger by instantiating the PluginWatcher class. When
the event that the workflow trigger defines occurs, the plug-in watcher notifies any workflows that are
waiting for that event.
3 Publish Plug-In Watchers on page 177
You implement the IPluginPublisher interface to publish plug-in watchers to the Orchestrator
notification mechanism.
Set Up the Watcher Implementation
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.
Prerequisites
n
Download the bundle of Orchestrator examples.
n
Unzip the examples bundle to an appropriate location.
Procedure
1 Create and save a Java file for the plug-in watcher class.
In the solar system example, the watcher class is named SolarSystemWatchersManager.java.
2 Declare the package that contains the Java classes of the plug-in implementation.
The solar system example declares the following package:
package com.vmware.orchestrator.api.sample.solarsystem;
Chapter 7 Developing Plug-Ins
VMware, Inc. 175