script.env
Interface ScriptEnvironment


public interface ScriptEnvironment

ScriptEnvironment provides methods for the JavaScript code to access Sentinel objects created within the context of an action.

The environment can be accessed within the script using a variable called scriptEnv.

Example to access the correlated event and print causal events:

     importPackage(java.lang);
     var corrEvt = scriptEnv.getCorrelatedEvent();
     var causalEvents = corrEvt.getCorrelatedEventCollection();
     if (causalEvents) {
        for (var it = causalEvents.iterator(); it.hasNext(); ) {
                        var event = it.next();
                        System.out.println(event.toXmlString());
                  }
     }
 

scriptEnv is read only and any assignment to it will fail silently.


Method Summary
 java.lang.String getContextName()
          The name of the context within which the script action is executed.
 CorrelatedEvent getCorrelatedEvent()
           
 Event getCurrentEvent()
           
 Incident getIncident()
           
 java.lang.String getRuleName()
           
 

Method Detail

getContextName

java.lang.String getContextName()
The name of the context within which the script action is executed.

Returns:
"Script Action" or "Incident Action"

getCorrelatedEvent

CorrelatedEvent getCorrelatedEvent()
Returns:
the correlated event produced by the firing of the rule

getCurrentEvent

Event getCurrentEvent()
Returns:
current event processed by the rule

getIncident

Incident getIncident()
Returns:
an incident object created by the incident action
See Also:
getContextName()

getRuleName

java.lang.String getRuleName()
Returns:
name of the rule that triggered this action