[QFJ-248] Data dictionary does not parse header repeating groups correctly Created: 24/Sep/07  Updated: 31/Aug/08  Resolved: 22/Dec/07

Status: Closed
Project: QuickFIX/J
Component/s: Metadata/Specs
Affects Version/s: 1.2.1
Fix Version/s: 1.3.1

Type: Bug Priority: Default
Reporter: CaiQi Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Environment:

winXP SP2, JDK1.5.0.12, Eclipse 3.3



 Description   

In QFJ_1.2.1, I can't use the repeating group "NoHops"and the fiels 628,629,630. I only can use field 627.

Because repeating group "NoHops" is the only group at messageHeader, so in many places, we may ignore it! For example, at DataDictionary.java,

private void load(InputStream inputStream) throws ConfigError {
.......

// HEADER
NodeList headerNode = documentElement.getElementsByTagName("header");
if (headerNode.getLength() == 0)

{ throw new ConfigError("<header> section not found in data dictionary"); }

NodeList headerFieldNodes = headerNode.item(0).getChildNodes();
if (headerFieldNodes.getLength() == 0)

{ throw new ConfigError("No header fields defined"); }

for (int i = 0; i < headerFieldNodes.getLength(); i++) {
Node headerFieldNode = headerFieldNodes.item;
String nodeName = headerFieldNode.getNodeName();
if (nodeName.equals("field") || nodeName.equals("group")) {
String name = getAttribute(headerFieldNode, "name");
if (name == null)

{ throw new ConfigError("<" + nodeName + "> does not have a name attribute"); }

String required = getAttribute(headerFieldNode, "required", NO);
if (required == null)

{ throw new ConfigError("<" + headerFieldNode.getNodeName() + "> does not have a 'required' attribute"); }

addHeaderField(lookupXMLFieldNumber(document, name), required.equalsIgnoreCase("Y"));
}
........
}

It only load <group name="NoHops" required="N"> from fix44.xml, but can't load <field name="HopCompID" required="N"/>Unable to render embedded object: File ("<field name="HopSendingTime" required="N"/>) not found."<field name="HopRefID" required="N"/> which are in the group.

So, maybe, we should add:

if (nodeName.equals("group")) {
String required = getAttribute(headerFieldNode, "required");
if (required == null)

{ throw new ConfigError("<group> does not have a 'required' attribute"); }

addHeaderXMLGroup(document, headerFieldNode, this, required
.equalsIgnoreCase("Y"));
}
}

there, I used a new function:addHeaderXMLGroup(),coming from addXMLGroup().

This question may relate to addXMLComponentFields(), addXMLGroup(), addGroup(), isGroup(), getGroup(), checkGroupCount(), iterate() at DataDictionary.java; and parseGroup(), parseHeader() at Message.java; where ignore the only group at messageHeader, "NoHops".



 Comments   
Comment by CaiQi [ 24/Sep/07 ]

Sorry, I want to change "Component/s" to be "Metadata/Specs", it is better than "Engine ".

Comment by Steve Bate [ 22/Dec/07 ]

Modified DataDictionary to parse header repeating group information. Added tests to DataDictionarTest and MessageTest that use the changes.

Generated at Sat Nov 23 07:16:36 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.