Apama 10.7.2 | Developing Apama Applications | EPL Reference | Types | Type properties summary
 
Type properties summary
Apama type properties include the following:
*Indexable — An indexable type can be referred to by a qualifier in an event template.
*Parseable — A parseable type can be parsed and has canParse() and parse() methods. The type can be received by the correlator.
*Routable — A routable type can be a field in an event that is
*Sent by the route statement
*Sent by the send...to or enqueue...to statement
*Sent outside the correlator with the emit statement
*Comparable — A comparable type can be used as follows:
*Dictionary key
*Item in a sequence on which you can call sort() or indexOf()
*Stream query partition key
*Stream query group key
*Stream query window with-unique key
*Stream query equijoin key
*Potentially cyclic — A potentially cyclic type uses the @n notation when it is parsed or converted to a string. When a potentially cyclic type is cloned, the correlator uses an algorithm that preserves aliases. See Potentially cyclic types
*Acyclic — An acyclic type is a type that is not potentially cyclic.
*E-free — E-free types cannot contain references to instances of a particular event type E. This property is used only to determine whether E is acyclic.
The following table shows the properties of each Apama type.
Type
Indexable
Parseable
Routable
Comparable
Acyclic
E-free
boolean
decimal
 1
float
 1
integer
string
location
Channel
2
Exception
context
 
any
3
3
3
listener
chunk
stream
action
sequence
dictionary
optional
event E
 4
 4
Legend:
Symbol
Description
Yes. This type has the corresponding property.
1 Attempts to use a NaN in a key terminates the monitor instance.
2 A Channel object is parseable only when it contains a string.
3 The any type is treated as parseable, routable and comparable, but it is comparable only if the contained type does not contain aliases. If the type of the value contained within it does not meet these requirements, such operations will throw an exception at runtime. An empty any value is parseable and comparable, and can be routed as a field of an event, but not as an argument to route.
No. This type does not have the corresponding property.
This type inherits the corresponding property from its constituent types, that is, the item type in a sequence, the key and item types in a dictionary, the types of fields in an event. The type has the corresponding property only when all its constituent types have that property.
4 An event defined inside a monitor cannot be received from an external source nor emitted from that correlator. An event defined inside a monitor can be sent or enqueued only within the same correlator.
The type is comparable only when all its constituent types are both comparable and acyclic.
An event E is acyclic only when all its constituent types are both acyclic and E-free.
Examples
The following code provides examples of event type definitions and their properties.
// You can do everything with "Tick", including index both its fields.
 
event Tick {
string symbol;
float price;
}
 
// You can do everything with "Order", except refer to its target or
// properties fields in an event template.
 
event Order {
string customer;
Tick target;
string symbol;
float quantity;
dictionary<string,string> properties;
}
 
// The correlator cannot receive the next event as an external event,
// but you can send it, route it, or enqueue it to a context.
 
event SubscriptionRequest {
string channel;
context recipient;
}
 
// You can do very little with this event except access its members and
// methods. It cannot be routed, you cannot sort sequence<TimeParse>,
// trying to group a stream query by TimeParse is illegal, and so on.
 
event TimeParse {
import "TimeFormatPlugin" as TF;
string pattern;
chunk compiledPattern;
}
 
// This has all the same restrictions as TimeParse, but is also
// potentially cyclic, so will use the @n format when parsed or
// converted to a string.
 
event Room {
string roomName;
float squareFeet;
sequence<Room> adjacentRooms;
sequence<Employee> occupants;
}