Download Documentation

Transcript
Chapter 7. Script Steps
After the mapper has delivered its requitition, multiple script steps can be used to
customize the result. These script steps can change the requisition initially provided by
the mapper. Script steps provide a requisition as their results, which allows the chaining
of script steps. Every script step has access to the latest version of the requisition. The
first script step reads the requisition from the mapper. The second script step reads
the requisition provided by the first script step and so on. Additionally every script step
can access the configuration of PRIS and the raw result of the source. The script steps
are executed by the JVM following the JSR-223 specification. Therefore all JSR-223
supported languages can be used to write script steps. By default runtimes for Groovy
2.3.3 and Beanshell 2.0b5 are provided out of the box.
Every script step has to provide a Requisition object as its result. For every request of
a requisition each script step is reloaded.
Script steps are configured in the requisition.properties for the requisition.
/opt/opennms-pris
### requisitions
|
### myRequisitionConfiguration
|
### requisition.properties
### scriptsteps
### default
|
### reverseDNS.groovy
|
### requisitionRename.groovy
|
### IgnoreNodeByCategory.groovy
### custom
### myScript.groovy
How to add script steps
### File: requisition.properties
## source configuration part
source = ...
## Run a no operation mapper
mapper = echo
# run script step
32