Translating EPL events using the apama.eventMap host plug-in
The eventMap plug-in translates events to or from map objects, reflecting the structure of the event. Each map entry has a key which is the same as an EPL event field. The values of the map can be simple values (strings, numbers) or further maps or lists which correspond to dictionaries, nested events or sequences.
If the message's payload does not contain all EPL fields, then by default the message is dropped and a warning is logged. The allowMissing configuration property can be set to true, in which case missing fields or fields with empty values are set to their default values.
If the message's payload has fields that do not have corresponding EPL fields (or which are perhaps optional), then the map entries are ignored by default. An event definition can specify a
com.softwareag.connectivity.ExtraFieldsDict annotation that names a dictionary field; extra values are placed in the dictionary (see
Map contents used by the apama.eventMap host plug-in for more information). If needed, this can be disabled by setting the
extraFields configuration property to
false. The dictionary must be one of the following types:
dictionary<string,string> - Keys and values are coerced into strings. Lists generate the string form of
sequence<string>. Maps generate the string form of
dictionary<string,string>.
dictionary<any,any> - Values are mapped to the corresponding EPL type, or
sequence<any> for lists and
dictionary<any,any> for maps without names.
dictionary<string,any> - Keys are coerced into strings.
When events are sent from a chain to the correlator, the correlator needs to know what event type they are. This can be set by a chain plug-in (in the metadata of a message) or by setting the defaultEventType configuration property. The metadata will take precedence to specify a message's type. Some chains will set the event type on every message, so the default event type does not need to be set in the configuration. Other chains may not be aware of event types, so the event type must be set.
Configuration Property | Description |
defaultEventType | Optional. The name of the EPL type to which events that are going into the correlator are converted if no event type is specified on a message. Type of configuration: string. Default: none - requires that the chain send messages with the event type set. |
allowMissing | Optional. Defines whether missing fields or fields with empty values (null values in Java) are permitted on inbound events. If they are permitted, they are set to the EPL default for that type. Similarly, empty values in nested events, elements in sequences and key/value pairs in dictionaries are also set to their default values. There is an exception: an empty value that maps to an optional<type> or any in EPL is permitted even if allowMissing is false. See also the descriptions of the optional and any types in the
API Reference for EPL (ApamaDoc) . Type of configuration: boolean. Default: false - this results in a WARN, and the events are dropped if there are any missing or empty fields. |
extraFields | Optional. Defines whether to place map keys that do not name fields in an extraFields dictionary member that is identified with the @ExtraFieldsDict annotation (see above). Type of configuration: boolean. Default: true. |