Apama 10.3 | Apama Documentation | Developing Apama Applications | Developing Apama Applications in EPL | Getting Started with Apama EPL | Defining event types | Format for defining event types
Format for defining event types
In EPL, the format for an event type definition is as follows:
event event_type {
[ wildcard] field_type field_name; |
   constant field_type field_name := literal; |
] ... 
Syntax description
Syntax Element
This EPL keyword is required. It indicates an event type definition.
Replace event_type with a name that you choose for this event type. An EPL best practices convention is to specify an initial capital in event type names, and to capitalize subsequent words in the name. For example: StockTick.
{ }
Enclose the field definitions in curly braces.
Specify the wildcard keyword in front of a field definition when you are certain that you will never specify that field in the match criteria for this event type. In other words, when the correlator watches for certain events of this type, the value of a wildcard field is always irrelevant.
Replace field_type with the name of a type. If you specify action, sequence, stream or dictionary, you must also specify the type of the action's argument(s) and return value if there are any, the type of the values in the sequence or stream, or the type of the dictionary's key as well as the type of the values in the dictionary. For example: dictionary<integer,string>. For more details, see the descriptions of the dictionary and sequence types in the API Reference for EPL (ApamaDoc) .
Replace field_name with a name that you choose for this field.
An event can have zero or more fields. You might define an event with no fields in a situation where only detection of the event is needed to start some process.
While there is no limit to the number of fields in an event, the correlator can index up to 32 fields per event. This means that the correlator can match on up to 32 fields per event. If an event type has more than 32 fields, you must specify the wildcard keyword for the additional fields. Note that if the type of an event field is location, that field counts as 2. For example, if you have 28 non-location type fields and 2 location fields, then you have reached the limit of 32 indexed fields. If you try to inject an event definition that specifies more than 32 fields and you do not specify the wildcard keyword for additional fields, the correlator rejects the file. You must add the wildcard keywords to be able to inject the file.
Specify the constant keyword in front of a field definition whose type is boolean, decimal, float, integer, or string and whose value never changes.
If you specify the constant keyword, you must assign a literal to that field. The type of the literal must be the same as the field_type you specified for this field.
When you specify an action in an event type definition you can call that action on an instance of the event (see Specifying actions in event definitions), unless it is a static action, in which case you can instead call it on the event type itself (see Defining static actions).

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.