Searching the Help
To search for information in the Help, type a word or phrase in the Search box. When you enter a group of words, OR is inferred. You can use Boolean operators to refine your search.
Results returned are case insensitive. However, results ranking takes case into account and assigns higher scores to case matches. Therefore, a search for "cats" followed by a search for "Cats" would return the same number of Help topics, but the order in which the topics are listed would be different.

Search for | Example | Results |
---|---|---|
A single word | cat
|
Topics that contain the word "cat". You will also find its grammatical variations, such as "cats". |
A phrase. You can specify that the search results contain a specific phrase. |
"cat food" (quotation marks) |
Topics that contain the literal phrase "cat food" and all its grammatical variations. Without the quotation marks, the query is equivalent to specifying an OR operator, which finds topics with one of the individual words instead of the phrase. |

Search for | Operator | Example |
---|---|---|
Two or more words in the same topic |
|
|
Either word in a topic |
|
|
Topics that do not contain a specific word or phrase |
|
|
Topics that contain one string and do not contain another | ^ (caret) |
cat ^ mouse
|
A combination of search types | ( ) parentheses |
|
Groovy script methods
If you are using a Groovy script to integrate external event processes, that Groovy script must implement the methods defined by the ExternalProcessAdapter
interface.
The methods that must be implemented by the Groovy script are listed in this section.
init, destroy, and ping Methods
The methods for initializing and closing the Groovy script, and verifying the Groovy script parameters are listed in this section.

The init(def args)
method is called when the Groovy script is first loaded. The loaded script is cached and called many times. It is only reloaded at startup and whenever the script or the configuration is changed in the Connected Servers manager. A separate instance is created for each connected server that uses this script.
The init(def args)
method has one argument, and the properties listed in Properties for init() Method.
Property |
Description |
---|---|
Read Properties |
|
|
OMi root directory. |
|
Type Used to access the logs. |
|
ID of the target connected server. |
|
Name of the target connected server. |
|
Display Name of the target connected server. |
|
DNS name of the target connected server. |
|
Type Integer. Port number of the web service, if any, for the target connected server. |
|
Type Boolean. Indicates if the target connected server web service requires TLS. |
|
DNS name of the target connected server where drill-down may be done. |
|
Type Integer. Drill-down port, if any, for the drilldown service on the target connected server drill-down node. |
|
Type Boolean. Indicates if the drill-down service requires TLS. |
|
Number of milliseconds to use for timeout on connections. You configure this in the Connected Servers manager. |
Write Properties |
|
None |
There are no write properties for this method. |

The destroy()
method is called when the Groovy script is no longer needed. It has no arguments.

The ping(def args)
method is called by the Connected Servers manager to determine whether the configuration parameters are correct. If the connected server is reachable using the specified read properties, the ping
method returns true, otherwise it returns false.
Properties for ping() Method lists the properties for the ping()method:
Property |
Description |
---|---|
Read Properties |
|
|
OMi root directory. |
|
Type Used to access the logs. |
|
Name of the target connected server. |
|
Display Name of the target connected server. |
|
DNS name of the target connected server. |
|
Type Integer. Port number of the web service, if any, for the target connected server. |
|
Type Boolean. Indicates if the target connected server web service requires TLS. |
|
Type Credentials, if any, for the target connected server. |
|
Type: Locale The desired locale of the properties that are set. |
Write Properties |
|
|
Detailed results of the ping operation. This is displayed in the Connected Servers configuration dialog box, and should be in the desired locale. |
Methods for Forwarding Events to a Connected Server
The methods for forwarding events to an external event processing application, configured as a target connected server, are listed in this section.

The forwardEvent(def args)
method is called to forward the event to the target connected server. This method has one argument, with the properties listed in Properties for forwardEvent() Method:
Properties for forwardEvent() Method
Property |
Description |
---|---|
Read Properties |
|
|
Type: Credentials, if any, for the target connected server. |
|
Type: This is the event to be forwarded. |
|
Type: Holds information regarding the type of forwarding, that is: |
|
If this is a symptom, the cause is set, and the cause has been forwarded to the target server, this property holds the external reference ID of the cause, otherwise null is returned. |
Read Methods |
|
|
Type: Credentials, if any, for the target connected server. |
|
Enables getting a specified event. If the event exists and the application has access to it, it is returned, otherwise null is returned. If the caller wishes the references to be resolved, set |
|
Enables getting a specified event. If the event exists and the application has access to it, it is returned, otherwise null is returned. If the caller wishes the references to be resolved, set |
getCi(id)
|
Obtains details of a configuration item, including all properties. Arguments are of type String. The method returns the specified configuration item, including all properties. Return value is of type |
Write Properties |
|
|
Optional. If set, enables drill-down into the external application in the Event Browser. This is the base path of the URL, and does not include node or port |
|
Must be set if forward is successful. Can be any string value. |

The forwardEvents(def args)
method is called to forward a list of events to the target connected server. This method is passed a single argument, that contains a list of events to forward, as well as some utility methods. There is also a method to set the forward result of each event in the list. If the forward result is not set for one of the events it will remain in the forwarding queue and will be retried on the next call to the groovy script. The result for each individual event may be set to success or failed. This method is optional.
The method forwardEvent()
has utility methods to enable the groovy script to easily obtain the OprForwardingInfo
. BulkForwardEventArgs
does not directly provide this utility method. To obtain the OprForwardingInfo
for each event, the you can call the method getForwardingInfo(final String serverId)
on each event. The serverId
is the ID of this connected server and was passed to the groovy script in the InitArgs
.
This method has one argument (BulkForwardEventArgs
), with the properties listed in Properties for forwardEvents() Method:
Properties for forwardEvents() Method
Property |
Description |
---|---|
Read Properties |
|
|
Type: Credentials, if any, for the target connected server. |
|
Type: This is the list of events to be forwarded. |
Read Methods |
|
|
Enables getting a specified event. If the event exists and the application has access to it, it is returned, otherwise null is returned. If the caller wishes the references to be resolved, set |
|
Enables getting a specified event. If the event exists and the application has access to it, it is returned, otherwise null is returned. If the caller wishes the references to be resolved, set |
getCi(id)
|
Obtains details of a configuration item, including all properties. Arguments are of type String. The method returns the specified configuration item, including all properties. Return value is of type |
getCauseExternalRefId(symptomId)
|
Obtains an external reference ID. Arguments are of type String.The method returns the |
Write Methods |
|
|
This method enables setting the success for each individual event, along with the external reference ID and any cross launch URL for that external event. |
|
If the bulk forward fails, this method can be called, passing a |
|
Sets an individual event in the list to failed. This event is not retried. An optional reason may be specified or set to null. If neither |

The forwardChange(def args)
method is called to forward the event changes to the target connected server. This method has one argument, with the properties listed in Properties for forwardChange() Method:
Properties for forwardChange() Method
Property |
Description |
---|---|
Read Properties |
|
|
Type: The event changes to be forwarded. |
|
Type: Credentials, if any, for the target connected server. |
|
Type: String The ID of the external event that should be updated. |
|
Type: Holds information regarding the type of forwarding, that is: |
|
Returns a copy of the event in its current state. The attributes of the event reflect the current state of the event at the time this call was made, and not the state when the change occurred. |
|
If this is a symptom, the cause is set, and the cause has been forwarded to the target server, this property holds the external reference ID of the cause, otherwise null is returned. |
Read Methods |
|
|
Enables getting a specified event. If the event exists and the application has access to it, it is returned, otherwise null is returned. If the caller wishes the references to be resolved, set |
|
Enables getting a specified event. If the event exists and the application has access to it, it is returned, otherwise null is returned. If the caller wishes the references to be resolved, set |
getCi(id)
|
Obtains details of a configuration item, including all properties. Arguments are of type String. The method returns the specified configuration item, including all properties. Return value is of type |
Write Properties |
|
None |
There are no write properties for this method. |

The forwardChanges(def args)
method is called to forward the event changes to the target connected server. This method is passed a single argument, that contains a list of event changes to forward, as well as some utility methods. There is also a set of methods to set the forward result of each event change item in the list. If the forward result is not set for one of the event changes it will remain in the forwarding queue and will be retried on the next call. The result for each individual event change may be set to success or failed. This method is optional.
This method has one argument (BulkForwardChangeArgs
), with the properties listed in Properties for forwardChanges() Method:
Properties for forwardChanges() Method
Property |
Description |
---|---|
Read Properties |
|
|
Type: The event changes to be forwarded. |
|
Type: Credentials, if any, for the target connected server. |
Read Methods |
|
getCi(id)
|
Obtains details of a configuration item, including all properties. Arguments are of type String. The method returns the specified configuration item, including all properties. Return value is of type |
|
Enables getting a specified event. If the event exists and the application has access to it, it is returned, otherwise null is returned. If the caller wishes the references to be resolved, set |
|
Enables getting a specified event. If the event exists and the application has access to it, it is returned, otherwise null is returned. If the caller wishes the references to be resolved, set |
getCauseExternalRefId(symptomId)
|
Obtains an external reference ID. Arguments are of type String.The method returns the |
OprForwardingInfo getForwardingInfo(change)
|
Obtains details of the forwarding information, including all properties. Arguments are of type String. This method gets the The external reference ID can be obtained from this forwarding info. |
Write Methods |
|
|
Sets success for all changes in the list. |
|
Sets success for the specified change in the list. |
|
Sets all changes in the list to failed. A reason may be specified in the form of an Exception, or null may be specified. If set to failed, the changes are not retried. |
|
Set the specified change to failed. This change is not retried. If neither |
Methods for Receiving Synchronization Data from a Connected Server
The methods for receiving synchronization data from an external event processing application, configured as a target connected server, are listed in this section.
Note These methods are only needed if the connected server supports the synchronizing back of event changes from the connected server.

The receiveChange(def args)
method is called when the connected server sends an event change to the Event Synchronization Web Service. This method has one argument with the properties listed in Properties for receiveChange() Method:
Properties for receiveChange() Method
Property |
Description |
---|---|
Read Properties |
|
|
Type: OprEvent A read only copy of the event in its current state, before any changes are applied. This is for read-only. To update the event set one of the writable properties of the arguments. |
|
Type: String The payload of the web service call (PUT or POST) received from the connected server when a change is synchronized back from the connected server. |
|
Type: Holds information regarding the type of forwarding, that is: |
|
Type: Locale The desired locale of the web service caller. |
|
Type: String The ID of the external event that should be updated. |
|
If this is a symptom, the cause is set, and the cause has been forwarded to the target server, this property holds the external reference ID of the cause, otherwise null is returned. |
Read Methods |
|
|
Enables getting a specified event. If the event exists and the application has access to it, it is returned, otherwise null is returned. If the caller wishes the references to be resolved, set |
|
Enables getting a specified event. If the event exists and the application has access to it, it is returned, otherwise null is returned. If the caller wishes the references to be resolved, set |
getCi(id)
|
Obtains details of a configuration item, including all properties. Arguments are of type String. The method returns the specified configuration item, including all properties. Return value is of type |
Write Properties |
|
|
ID of the event. |
|
Title of the event. |
|
Description of the event. |
|
Solution of the event. |
|
Severity of the event. |
|
Priority of the event. |
|
State of the event. If set to |
|
ID of the cause event. |
|
Type: Name of the user who is responsible for solving the event's underlying problem. |
|
Type: Name of the group to which the event's assigned user belongs. |
Additional Methods
Additional methods are provided for transferring the control of an event, annotations, custom attributes, configuration items, and for accessing the HTTP requests and responses.

The methods available for transferring control of an event are listed here.
-
requestControl
The
requestControl
method is a request to take control of the event. Once a request has been made, it is not possible for the event to be owned by another server. The request is queued, and when completed, the caller receives a change notification for thecontrol_transferred_to
event property. -
returnControl
The
returnControl
method returns the control of the event back from the external event process to OMi. The caller must have control of the event in order to return control. The request is queued, and when completed, the caller receives a change notification for thecontrol_transferred_to
event property.

The methods available for annotations are listed here. Annotations may be added or updated, but not deleted.
-
addAnnotation(def text, def author)
The
addAnnotation(def text, def author)
method adds an annotation. Arguments are of type String. -
updateAnnotations(def id, def text, def author)
The
updateAnnotation(def id, def text, def author)
method updates an annotation. Arguments are of type String.

The methods available for custom attributes are listed here.
-
addCustomAttribute(def name, def value)
The
addCustomAttribute(def name, def value)
method adds a custom attribute. Arguments are of type String. -
updateCustomAttribute(def name, def value)
The
updateCustomAttribute(def name, def value)
method updates a custom attribute. Arguments are of type String.

Three methods are provided for accessing the HTTP request or response.
-
getHttpRequestHeader(def name)
The
getHttpRequestHeader(def name)
method returns a list of header values. Arguments are of type String. -
setHttpResponseStatus(def httpResponseCode, def httpResponseMessage)
The
setHttpResponseStatus(def httpResponseCode, def httpResponseMessage)
method can be called to control the response status and payload. Default is 202 and no payload. The code is of type Integer, message is of type String. -
setHttpResponseHeader(def name, def value)
The
setHttpResponseHeader(def name, def value)
method enables setting of the specified HTTP response header. Arguments are of type String.

The receiveChanges(def args)
method is called when the connected server sends multiple event changes to the Event Synchronization Web Service. This method is passed a single argument, that contains the payload sent by the external processing server to the Event Synchronization WS endpoint /opr-gateway/rest/9.10/event_change, as well as some utility methods. It is expected the payload contains a list of changes. It is up to the groovy script method to interpret the list of changes and apply them to an event. This is done through a utility method to create a ReceiveChangeArgs object for each event that is to be changed and setting the changes in that object.
This method has one argument (BulkReceiveChangeArgs
) with the properties listed in Properties for receiveChanges() Method:
Properties for receiveChanges() Method
Property |
Description |
---|---|
Read Properties |
|
|
Type: String The payload of the web service call (PUT or POST) received from the connected server when one or more changes are synchronized back from the connected server. |
|
Type: Locale The desired locale of the web service caller. |
Read Methods |
|
|
Enables getting a specified event. If the event exists and the application has access to it, it is returned, otherwise null is returned. If the caller wishes the references to be resolved, set |
|
Enables getting a specified event. If the event exists and the application has access to it, it is returned, otherwise null is returned. If the caller wishes the references to be resolved, set |
getCi(id)
|
Obtains details of a configuration item, including all properties. Arguments are of type String. The method returns the specified configuration item, including all properties. Return value is of type |
getHttpRequestHeader(name)
|
Obtains the specified header. Header may be specified more than once. All instances specified are returned. |
|
Gets the |
Methods for Retrieving Data from a Connected Server
The methods for retrieving data from a connected server are listed in this section.

The getExternalEvent()
method is called when the operator requests the current representation of the external event. When the operator opens the Event Details in the Event Browser and selects the External Info tab, or uses the context menu in the Event Browser, the getExternalEvent()
method is called to get the latest copy of the external event, and display selected fields in the Event Browser. This method has one argument with the properties listed in Properties for getExternalEvent() Method:
Properties for getExternalEvent() Method
Property |
Description |
---|---|
Read Properties |
|
|
The external reference ID, identifying the external event to get. |
|
Type: Credentials, if any, for the target connected server. |
|
Type: Locale The desired locale of the properties that are set. |
Write Properties (All are of type String) |
|
|
Optional. Title of the external event. |
|
Optional. Description of the external event. |
|
Optional. User assigned to the external event. |
|
Optional. User group assigned to the external event. |
|
Optional. Severity of the event. |
|
Optional. Priority of the event. |
|
Optional. State of the event. |
Method for Supplying Data to a Connected Server
There is also a method for supplying data to a target connected server.

The toExternalEvent()
method converts an OPR Event into an external event object. This method is called when a connected server queries the Event Synchronization Web Service for the latest copy of the OPR Event. This enables an integrator to convert the event to an external event representation, that is, to create the response payload of the GET from (.../event/<event id>).
This method has one input parameter: com.hp.opr.api.ws.model.event.OprEvent
The return value of this method is a string. This is the payload that is returned to the application that called the web service.
Management of Groovy Script Methods
The Groovy script methods run under a separate Java Security Manager. The following permissions are denied by the Java Security Manager:
-
access to the
System.exit()
call -
java.lang.RuntimePermission
only for target exitVM:http://java.sun.com/javase/6/docs/api/java/lang/RuntimePermission.html
We welcome your comments!
To open the configured email client on this computer, open an email window.
Otherwise, copy the information below to a web mail client, and send this email to ovdoc-asm@hpe.com.
Help Topic ID:
Product:
Topic Title:
Feedback: