Repeating groups
Many FIX messages contain repeating groups of fields which must be mapped to Apama sequences. Each repeating group has a corresponding sub-event defined in the event mapping.
For example, the following event mapping for MarketDataIncrementalRefresh defines a repeating group (NoMDEntries) which is defined as a sequence of MarketDataIncrementalRefresh_MDEntry events:
<event name="MarketDataIncrementalRefresh" encoder="FilterCodec"
direction="both" copyUnmappedToPayload="true" inject="true"
package="com.apama.fix">
<id-rules>
<downstream>
<id fields="35" test="==" value="X"/>
</downstream>
<upstream/>
</id-rules>
<mapping-rules>
<map apama="TRANSPORT" type="string" default="" transport="transportName"/>
<map apama="SESSION" type="string" default="" transport="SESSION"/>
<map apama="MDReqID" type="string" default="" transport="262"/>
<map apama="NoMDEntries" type="reference" referencetype="sequence
<MarketDataIncrementalRefresh_MDEntry>" default="[]"
transport="268"/>
<map type="string" default="X" transport="35"/>
</mapping-rules>
</event>
<event name="MarketDataIncrementalRefresh_MDEntry" encoder="FilterCodec"
direction="both" copyUnmappedToPayload="false" inject="true"
package="com.apama.fix">
<id-rules>
<downstream>
<id fields="35" test="==" value="_MarketDataIncrementalRefresh_MDEntry"/>
</downstream>
<upstream/>
</id-rules>
<mapping-rules>
<map apama="MDUpdateAction" type="string" default="" transport="279"/>
<map apama="MDEntryType" type="string" default="" transport="269"/>
<map apama="MDEntryID" type="string" default="" transport="278"/>
<map apama="Symbol" type="string" default="" transport="55"/>
<map apama="MDEntryPx" type="float" default="0.0" transport="270"/>
<map apama="MDEntrySize" type="float" default="0.0" transport="271"/>
<map apama="OrderID" type="string" default="" transport="37"/>
<map apama="_extraParams" type="reference" referencetype="dictionary
<integer, string>" default="{}"/>
<map type="string" default="_MarketDataIncrementalRefresh_MDEntry"
transport="35"/>
</mapping-rules>
</event>
Currently, the IAF Normalised Event does not provide a means of representing repeating groups of fields so these sequences must be encoded as strings when passed to or from the transport.
In order for the transport to be able to encode/decode repeating groups it is necessary to specify the structure of each sub-event as a transport property. For example, the following property defines the structure of the MarketDataIncrementalRefresh_MDEntry event:
<property name="X:268"
value="com.apama.fix.MarketDataIncrementalRefresh_MDEntry{
string 279; string 269; string 278; string 55; float 270; float 271;
string 37; }" />
The IAF configuration files distributed with the FIX adapter define properties for all sub-events in the FIX 4.2 specification and a subset of the most useful sub-events in the FIX 4.3 and 4.4 specifications. It is usually not necessary to modify these in any way. However, these properties must be included in any transport that is added. The distributed template configuration files demonstrate the XML "XInclude" syntax used to include the standard repeating group definitions into a FIX adapter configuration file.
For convenience, FIX adapter ships FIX-static-common.xml and FIX-static-groups.xml with mappings required for all standard FIX message types.