[QFJ-216] Support recursive custom group definitions in the code generator Created: 27/Jul/07 Updated: 27/Apr/11 |
|
Status: | Open |
Project: | QuickFIX/J |
Component/s: | Message Generation |
Affects Version/s: | 1.2.1 |
Fix Version/s: | Future Releases |
Type: | New Feature | Priority: | Default |
Reporter: | Lev Grevnin | Assignee: | Unassigned |
Resolution: | Unresolved | Votes: | 0 |
Labels: | None | ||
Environment: |
windows XP/java 1.5_06 |
Description |
Suppose I have the following xml message definition <message name="FirmPrice" msgtype="UN020" msgcat="app"> ... <component name="LegComponent"> The message generation creates a MessageFactory.java which has the following snippet of code in it: if("UN020".equals(msgType)) { } This cannot compile, obviously, as it has a duplicate case label. So, it seems like the usage of a field in both, the enclosing message and the nested component is not handled properly by the generated code. Looks like this is due to "NoPriceEntries" appearing twice: once in the main body of the message, and once in the subcomponent "LegComponent". |
Comments |
Comment by Steve Bate [ 16/Aug/07 ] |
Toli, any ideas on what we should do about this issue? The only idea I have is to have a second group generation method that accepts a list of message and group fields to identify the specific nested group to create. |
Comment by Toli Kuznets [ 17/Aug/07 ] |
Steve, This bug is a case of a group appearing twice in a message, once inside a "top-level" and then once again in a nested subgroup. If QFJ were to support this case, it'll probably make sense to make it available for any deep level of nesting, right? What does the FIX spec say about that? Can you have same groups showing up multiple times in different nested subgroups? I couldn't see the spec specifically disallowing it, so my guess is that this is allowed and we need to support it? A message specification is a hierarchical tree, with different fields appearing in different locations. Are the group fieldIDs treated as unique IDs that specify their location? (kind of like the <id> tag in HTML?) Sounds like we may need to pass all the information/context about the level of nesting into the factory message in order to able to create the groups at the right level of nesting... A workaround would certainly be to create more specific field types or change the name of some sub-group. Maybe create a NoPriceEntriesPerLeg ? This would be a straight-forward short-term workaround. |
Comment by Lev Grevnin [ 27/Nov/07 ] |
Hi. Did anyone manage to have a look at this? Is it still an issue? |
Comment by Lev Grevnin [ 20/Dec/07 ] |
Yes, indeed, it appears the quickfix 1.3.0 still suffers from this problem. It would be really nice to correct it. |
Comment by Steve Bate [ 26/Apr/11 ] |
I don't know if the specification prohibits it, but apparently there are no standard FIX group definitions that contain a repeating group of the same type (recursive group definition). Therefore, I changed this from a bug to a feature request and dropped the priority. I'm curious about whether the message parser will handle the recursive groups. |
Comment by Eric Deshayes [ 27/Apr/11 ] |
As it is a new feature that would have some impact on the generated classes (and therefore not be backward compatible), it is descoped from the 1.5.1 release. |