Apama Documentation : Developing Apama Applications : Developing Apama Applications in EPL : Defining Monitors : Adding predefined annotations
Adding predefined annotations
Some EPL language elements can take predefined annotations. They provide the runtime and Software AG Designer with extra information about these language elements. Annotations can appear immediately before the following:
*Monitor declarations
*Event declarations
*Fields of events
*Actions in monitors or event definitions
Annotations have packaged names like events. Thus, either their full name, or (preferably) a using declaration should be added to the file to allow the name to be used without having to specify its full name. Annotations are written as an at symbol (@) followed by the name of the annotation, followed by parameters in parentheses. The values used in annotation parameters must be literals. If both annotations and ApamaDoc are specified, the order should be: ApamaDoc, followed by annotations, followed by the language element that they apply to.
The following annotations are available:
Annotation
Parameters
Description
SideEffectFree
None
This annotation is part of the com.apama.epl package. It tells the EPL compiler that this action has no side effects. When called from a log statement, the compiler is free to not call an action if it has no side effects and the log level is such that the log statement would not print anything to the log file. See Logging and printing.
OutOfOrder
None
This annotation is part of the com.apama.queries package. It tells the query runtime that these events may occur out of order. See Out of order events.
TimeFrom
string
This annotation is part of the com.apama.queries package. It tells the query runtime the default action name on the event definition to obtain source time from. See Using source timestamps of events.
Heartbeat
string
This annotation is part of the com.apama.queries package. It tells the query runtime the default heartbeat event type to use. See Using heartbeat events with source timestamps.
DefaultWait
string
This annotation is part of the com.apama.queries package. It tells the query editor in Software AG Designer the default time to wait to use. See Using source timestamps of events.
ExtraFieldsDict
string
This annotation is part of the com.softwareag.connectivity package. It names a field of type dictionary<string,string> where the apama.eventMap connectivity host plug-in will place unmapped entries. See Translating EPL events using the apama.eventMap host plug-in.
Example:
using com.apama.epl.SideEffectFree;

monitor SomeMonitor {
action onload() {
on all Event() as e {
log prettyPrint(e) at DEBUG;
}
}

@SideEffectFree()
action prettyPrint(Event e) returns string {
return e.field1 +" : "+e.field2.toString();
}
}
Copyright © 2013-2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback