fix-orchestra-spec icon indicating copy to clipboard operation
fix-orchestra-spec copied to clipboard

Clarify implicit link between field and code set scenarios

Open kleihan opened this issue 1 year ago • 2 comments

Section 3.8.2 Data domain of a field defines the following:

Since <codeSet> is also qualified by scenario, a field will link to the code set of the same scenario. By default, "base" scenario field links to "base" code set.

Has this paragraph become obsolete? There should be no more automatic link of field and code set scenario with v1.1 because a field now either has a datatype or a code set. A field with a scenario would then implicitly link to the datatype of code set scenario if there is one with the same name as the field scenario.

Provide an example with scenarios.

kleihan avatar Nov 10 '23 11:11 kleihan

V1.0 has an implicit link when using the scenario attribute in a field definition:

<fixr:field id="59" name="TimeInForce" type="TimeInForceCodeSet" scenario="DayOrders"/>

It requires the existence of a code set scenario with the same name that defines the valid codes for the field in that scenario:

<fixr:codeSet id="59" type="char" scenario="DayOrders">
    <fixr:code name="Day" id="59001" value="0"/>
</fixr:codeSet>

With V1.1 this implicit link then gets extended to datatype scenarios if the type attribute is used:

<fixr:field id="34" name="MsgSeqNum" type="int" scenario="SeqNum"/>

It requires the existence of a datatype scenario with the same name that defines the valid codes for the field in that scenario:

<fixr:datatype name="int" scenario="SeqNum">
	<fixr:mappedDatatype standard="XML" base="xs:positiveInteger"/>
	<fixr:mappedDatatype standard="ISO11404" base="Ordinal"/>
</fixr:datatype>

The implicit link between field and code set / datatype scenarios does not seem appropriate. Fields may need their own scenarios to distinguish between attributes other than codeSet and type, for example implLength.

<fixr:field id="448" name="PartyID" implLength="5" type="String" scenario="ShortPartyID"/>
<fixr:field id="448" name="PartyID" implLength="30" type="String" scenario="LongPartyID"/>

Hence it seems better to require explicit scenarios and no longer support implicit ones that may be subject to interpretation.

See also Pull Requests https://github.com/FIXTradingCommunity/fix-orchestra/pull/171 and https://github.com/FIXTradingCommunity/fix-orchestra/pull/173.

kleihan avatar Nov 17 '23 13:11 kleihan

https://github.com/FIXTradingCommunity/fix-orchestra/pull/171 asks for the addition of typeScenario and codeSetScenario to remove ambiguity. A field definition not only has a type (datatype or scenario) attribute but numerous others:

minInclusive maxInclusive implLength implMinLength implMaxLength presence encoding value rendering

Hence a field could not only have two or more type (datatype or code set) scenarios but also others. One would want to express a field scenario together with a type scenario in such cases. A single attribute scenario is then no longer sufficient. However, a use case is needed to show that this is not just a theoretical case.

kleihan avatar Jan 15 '24 16:01 kleihan