Type properties summary
Apama data 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
enqueue statement
Sent by the
enqueue event to context 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 typesAcyclic — 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 data type.
Data Type | Indexable | Parseable | Routable | Comparable | Acyclic | E-free |
boolean | | | | | | |
decimal | | | | 1 | | |
float | | | | 1 | | |
integer | | | | | | |
string | | | | | | |
location | | | | | | |
context | | | 2 | | | |
listener | | | | | | |
chunk | | | | | | |
stream | | | | | | |
action | | | | | | |
sequence | | | | | | |
dictionary | | | | | | |
event E | | 3 | 3 | | | |
| Yes. This type has the corresponding property. 1 Attempts to use a NaN in a key terminates the monitor instance. 2 Although a context can be enqueued, it is not parseable, so the correlator will reject it from the input queue with a warning. |
| 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. 3 An event defined inside a monitor cannot be emitted, enqueued or received by the 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 this as an external event and you cannot
// usefully enqueue it, but you can 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;
}
Copyright © 2013
Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.