Apama 10.3 | Apama Documentation | Deploying and Managing Apama Applications | Correlator Utilities Reference | Event file format | Event types
Event types
The following example illustrates how each type is specified in an event representation. Given the event type definitions:
event Nested {
  integer i;
event EveryType {
  boolean b;
  integer i;
  float f;
  string s;
  location l;
  sequence<integer> si;
  dictionary<integer, string> dis;
  Nested n;
optional<Nested> opt;
any anyValue;
the following is an expanded string representation for an EveryType event:
EveryType (
  true,                # boolean is true/false (lower-case)
  -10,                 # positive or negative integer
  1.73,                # float
  "foo",               # strings are (double) quoted
  (1.0,1.0,5.0,5.0),   # locations are 4-tuples of float values
  [1,2,3],             # sequences are enclosed in brackets []
  {1:"a",2:"b"},       # dictionaries are enclosed in braces {}
  Nested(1),           # nested events include event type name
optional(Nested(10)) # optional payload inside parentheses, may be empty, in
# which case it is represented by the string "optional()"
any(integer,42) # any names a type and the string form of that type;
# other examples include the following:
# any(sequence<Nested>,[Nested(1)])
# may also be empty, in which case the string form is:
# "any()"
Note: This example is split over several lines for clarity. In practice, this definition must all be written on the same line, and without the comments. Otherwise the correlator will fail to parse the event.
Types can of course be nested to create more complex structures. For example, the following is a valid event field definition:
sequence<dictionary<integer, Nested> >
and the following is a valid representation of a value for this field:
[{1:Nested(1)}, {2:Nested(2)}, {3:Nested(3)}]
You can also get an event's string representation in EPL by using the toString() method.

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.