EPL changes that might have migration implications
This topic describes EPL changes and enhancements. If you use these EPL features in applications that you are migrating from Apama 4.3 you might need to change the application before you can run it with the newer Apama release.
See also:
EPL changes without migration implications, which describes EPL enhancements that do not require updates for migrating applications from Apama 4.3, other than to implement the new features.
Streams: prohibition of taking the rstream of an aggregate projection
In previous releases, expressions such as the following have technically been legal. In Apama 5.0, the use of the rstream keyword in conjunction with an aggregate projection has been withdrawn.
for a in aF within 10.0 select rstream sum(a.x)
Beginning with Apama 5.0. the taxonomy is that a projection can be:
istream projection (the default)
rstream projection (if
rstream is specified)
aggregate projection (if
having and/or
select expressions use an aggregate)
Additional changes in the EPL streams feature are:
A
stream type can now contain any type of item. Previously, a
stream type was restricted to containing
boolean,
float,
integer,
string, or
event type items.
You can now specify a
having clause to filter the items produced from the stream query's projection.
"persistent" is now an EPL keyword
As of Apama 5.0 it is no longer permissible to use persistent as an identifier, such as the name of a variable, monitor, or event. In this release persistent is a keyword used to designate a monitor as being persistent. Using it as an identifier will generate an error, unless you prefix it with a hash symbol (#).
The "call" statement is no longer valid
The use of the call statement has been deprecated for several releases and in Apama 5.0 it has been removed. To invoke an action, see "Defining actions" in Developing Apama Applications with EPL.
"streamsource" is reserved as a keyword
As of Apama 5.0, streamsource is now a keyword that is reserved for future use. Using it as an identifier will generate an error, unless you prefix it with a hash symbol (#).
"generates" is no longer a keyword
With this release, generates is no longer a keyword and it can be used as an identifier.
enqueue to default-constructed context
In previous releases, enqueuing to a default-constructed context rather than to an actual context silently did nothing. Beginning with Apama 5.0, code such as the following example will cause the correlator to terminate the monitor instance, which will assist developers in detecting problems caused by subtle coding bugs such as this.
monitor m {
context c;
action onload()
{
enqueue A() to c;
}
}
If you enqueue an event to a sequence of contexts and one of the contexts has the default value then the correlator terminates the monitor instance.
Apama macros generate-scenario(s) - force is removed
The force parameter has been removed from the Apama macros for Ant (install_dir\etc\apama-macros.xml)that are used when re-building Apama projects. This means Apama Studio always regenerates the EPL code for a scenario in order to ensure that the project uses the correct, up-to-date code.
Changes to the correlator plug-in API
The API version number has been stepped.
EPL plug-in support for the string type has changed. Strings are now immutable and cannot be modified by the plug-in once created.
Serialization and deserialization support has been removed. This means correlator plug-ins that support serialization will no longer compile until the obsolete code is removed.
The
AP_Type references obtained from the arguments (
AP_TypeList) are now
const.
AP_Chunk can now be default-constructed. In previous versions, it had to be passed
const AP_Context &.
ownerID has been removed from
AP_Chunk.
The
pluginID(),
registerChunk(), and
deregisterChunk() methods have been withdrawn from the
AP_Context interface.
The
AP_CorrelatorInterface cannot be used from chunk destructors.
The plug-in is responsible for deleting the old
AP_Chunk when setting a new value for a chunk. You should use
AP_Type::chunkValue(AP_Chunk *) to return the old
AP_Chunk *, which should then be deleted. This behavior is new in this release.
Various values are now
size_t not
uint32. Sequences larger than 2^
32 elements can be manipulated on 64-bit platforms.
Tweaked the
const-correctness of various
AP_Type methods.
One plug-in can no longer use chunks produced by another.
Time Format plug-in
In previous releases, the Time Format parse functions returned -1 when the specified string could not be parsed. Beginning with Apama 5.0, these functions return NaN on an error because in some circumstances -1 is a legitimate result when there has been no error. This behavior applies to the following functions:
parse()
parseTime()
parseUTC()
parseTimeUTC()
parseWithTimeZone()
parseTimeWithTimeZone()
Changes to special actions
In Apama 5.0 the behavior of special actions has been made more uniform. Specifically:
Beginning with this release, the
onBeginRecovery and
onConcludeRecovery actions must now contain no arguments and must return nothing. The correlator ensures this behavior and it is a compile-time error if you define one of these actions with any other signature
No member or monitor-scoped variable may have the name of a special action. This applies to the following:
Inside monitors these actions are
onload,
ondie,
onunload,
onBeginRecovery,
onConcludeRecovery.
Inside events these actions are
onBeginRecovery and
onConcludeRecovery.
Inside aggregates these actions are
init,
add,
remove,
value,
onBeginRecovery, and
onConcludeRecovery.
parse() removed from some EPL types
EPL code that calls parse() or canParse() on the following types will now give an error at injection time:
action listener chunk stream An event that contains an unparseable field
A
sequence that contains unparseable items
A
dictionary whose key or item type is unparseable
This is part of a simplification of the EPL type system, and means that incorrect code that would previously have injected but caused errors at runtime is now prevented from injecting to make the error more obvious.
indexOf() and sort() removed from some kinds of EPL sequence
EPL code that calls indexOf() or sort() (that is, actions requiring comparability of sequence elements) on sequences with the following element types will now give an error at injection time:
listener chunk stream action nested sequences, dictionaries or events that are potentially cyclic (that is, those that have circular type references)
This is part of a simplification of the EPL type system, and means that incorrect code that would previously have injected but caused errors at runtime - or subtle logic bugs - is now prevented from injecting, to make the error more obvious.
Withdrawal of support for non-threadsafe plug-ins
The threadsafe capability flag for plug-ins has been removed, and all plug-ins must now be threadsafe. Customers who need to perform non-threadsafe operations will need create their own mutex within the plug-in itself.
Deprecation of dictionary.getDefault
The
dictionary.getDefault() method has been deprecated. Use the new
dictionary.getOr() method instead. See "New dictionary methods" in
EPL changes without migration implications.
Deprecation of Payload Extraction plug-in
The Payload Extraction correlator plug-in is deprecated. All Apama adapter products now use dictionary-format payloads rather than string-format payloads. The dictionary-format payload is considerably more efficient in almost all cases. While string-format payloads are still accepted in Apama 5.0, this support, including the Payload Extraction correlator plug-in, is now deprecated and will be removed in a future release of the Apama platform. It is recommended that all third-party adapters are migrated to dictionary-format payloads as soon as possible.