Contents

 

Loading FIX message in Mapper

An option to load FIX message is provided in the eMapper tool. A FIX message structure can be added by choosing FIX after clicking the Add Structure button ( ) in the Input / Output Structures panel.

A list of different FIX versions and message types is displayed where the messages to be loaded can be chosen. Select the message types and click the Load button to load the messages types in to the workspace. Click Finish in the Add Structure wizard and the FIX message structure is loaded in Mapper as shown in the figure below.


Figure 1:  FIX message structure under Input Structures panel

Each field in a message is represented by a node. Repeating groups are represented using a [ONE MANY] node. The first child of a [ONE MANY] node is the NumInGroup node, representing the number of times the fields of the group are repeated, and the repeating fields are added as children to this node. A Component type in the message is denoted by a node with the component's fields, groups and sub-components added as its children.

To map FIX message fields to an XML message, load the input FIX message type in the Input Structure and the output schema in the Output Structure panel. A mapping can be created between two nodes by dragging the input node and dropping it on the output node. Define mapping from the input FIX message to the output XML.

To map a repeating group to an output node that has [ZERO MANY] or [ONE MANY] cardinality, map the NumInGroup field to the control node ([ZERO MANY] or [ONE MANY]) node and map the child nodes to their corresponding output nodes.

This generates a for-each mapping. In the example below, a for-each mapping is defined between the Events group in the input FIX message and the item element in the output XMLmessage which means that for each repetition of the group fields in the input, an output node <item> will be created.


Figure 2:  For-each mapping defined between Events group and Item element

Similarly, while mapping XML to FIX, the repeating element in the input has to be mapped to the [ONE MANY] node representing the group to generate a for-each mapping.

XSL generation

XSL is generated automatically when mappings are done. The generated XSL can be viewed in the Metadata tab of the editor.

Test Mappings

To test the XSL generated, click the Test button in the toolbar (), provide the input FIX message in the space provided and click Apply Transformation. The output xml will be generated.

Icon

Since the mapper tool uses XSL to perform the transformation, and XSL does not allow non-XML messages as input, the input FIX message is modified by adding <Message> and </Message> tags at the beginning and ending of the message. Also, the non-printable SOH character will be replaced by '^' as Unicode characters and are not allowed in an XML message.

Mapping XML to FIX

Mappings can be defined to transform an XML message to a FIX message by loading the XML structure in the Input panel and the FIX message type being generated in the output panel. If a required field in the message is not mapped to any element in the input, an error message is shown in the Metadata Messages view.

The values for fields BeginString(8), BodyLength(9), MessageType(35) and Checksum(10) will be generated automatically for the output FIX message. Any mappings defined for these fields will be ignored.

Defining FIX to XML or XML to FIX transformation on a Route

XML to FIX or FIX to XML transformations can also be defined on a route in an Event Process. The following points have to be noted while using FIX-XML conversions on a route.

  • Generated XSL uses java functions from the fix-xmlconverter.jar to fetch the value of field from the input FIX message string, calculate the body length / checksum of an output FIX message. This jar is present in the folder $FIORANO_HOME/eStudio/plugins/com.fiorano.tools.mapper.runtime_1.0.0/jars folder. This file needs to be added to the classpath of the peer server so that the peer server can access the functions while performing transformations. This can be done by adding the relative path to this file under <java.classpath> in fps.conf file present in $FIORANO_HOME/esb/fps/bin/ folder and in server.conf file present in $FIORANO_HOME/esb/server/bin/ folder.
  • As mentioned previously, the input document for an XSL should be an XML. While defining a route transformation from FIX to XML, the input FIX message needs to be modified by adding <Message> and </Message> tags at the beginning and ending of the message and by replacing the non-printable SOH character with '^'. This can be achieved by adding a java-script component which gets the text body of the JMS-Message, performs the required string operations (append and replace) and then set the resulting string back on the JMS-Message.
  • Similarly for XML to FIX messages defined on a route, the output message will contain  '' instead of the SOH character. A Java-script component here can replace all the occurrences of  ''  with the required component.

 

Adaptavist ThemeBuilder EngineAtlassian Confluence