Skip to content

Support cardinality of element usage references #289

Description

@kleihan

Messages can contain fields, components, and/or groups as an element usage reference. However, each reference to an element is for a single occurrence of the element. That does not mean than an element can only be referenced once. Orchestra supports more than one reference to the same element by means of the attribute instanceName, but that is not the same as supporting an arbitrary number of occurrence for a given element.

As illustarted below, it is proposed to add the cardinality attributes implMinOccurs and implMaxOccurs to field and component usage references.

The current Orchestra concept for an arbitrary number of occurrences of a field requires to wrap it into a repeating group. The repeating group is then the element used inside the message. It is a single occurrence of the group, but the elements inside the group can occur an arbitrary number of times.

    <fixr:field id="1308" name="ExecInstValue" type="ExecInstCodeSet"/>

    <fixr:group id="2126" name="ExecInstRules" abbrName="ExecInstRules" added="FIX.5.0" addedEP="-1" category="Common">
      <fixr:numInGroup id="1232"/>
      <fixr:fieldRef id="1308" name="ExecInstValue"/>
    </fixr:group>

    <fixr:message id="106" name="MarketDefinition" msgType="BU">
      <fixr:structure>
        ...
        <fixr:groupRef id="2127" name="ExecInstRules"/>
        ...
      </fixr:structure>
    </fixr:message>

The same applies to a component that is supposed to occur more than once, e.g. UndInstrmtGrp is a repeating group that has a single element, which is the component UnderlyingInstrument.

    <fixr:group id="2066" name="UndInstrmtGrp">
      <fixr:numInGroup id="711"/>
      <fixr:componentRef id="1021" name="UnderlyingInstrument"/>
    </fixr:group>

The issue does not apply to groups as their content is repeatable by definition. Group definitions and well as group references already support the cardinality attributes implMinOccurs and implMaxOccurs. This allows to define a base cardinality of repeating groups that can be overridden at the usage level inside a message (or when nested inside another group or component).

Cardinality attributes do not apply to the definition of fields or components, they only make sense at the usage level. In the first example above, a group ExecInstRules would not be needed if the unbounded cardinality of a field usage in a message could be expressed as follows (assuming defaults for min/max are 0/1):

    <fixr:message id="106" name="MarketDefinition" msgType="BU">
      <fixr:structure>
        ...
        <fixr:fieldRef id="2127" name="ExecInstRules" implMaxOccurs="unbounded"/>
        ...
      </fixr:structure>
    </fixr:message>

In the second example above, the definition of UndInstrmtGrp would not be needed. Note that FIX Trading Community defined an exception to the FIXML encoding rules to remove the inefficiency introduced by repeating groups with a component as single element. There are only a few examples:

  1. InstrumentLegGrp, abbreviated , is a repeating component that contains only the non-repeating
    component InstrumentLeg, also abbreviated .
  2. UndInstrmtGrp, abbreviated , is a repeating component that contains only the non-repeating
    component UnderlyingInstrument, also abbreviated
  3. InstrumentScopeGrp, abbreviated , contains the non-repeating group
    InstrumentScope, abbreviated as well as the field InstrumentScopeOperator.
  4. RiskInstrumentScopeGrp, abbreviated , contains the non-repeating group
    InstrumentScope, as above, and the fields InstrumentScopeOperator and RiskInstrumentMultiplier.

Please see EP105 (Appendix D - Inline Component Reference Enhancement to the FIXML Standard) for details. This exception could be removed with the support of element usage cardinality.

ISO 20022 does not define groups, only fields (simple types) and components (complex types). However, any usage of a field or component has an implicit or explicit cardinality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FEATURESmall enhancements

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions