Background
Following a recent DSL update (see DSL release notes) which adds additional logical checks related to cardinality, some errors were found in the model. These errors stem from an ambiguity of how to handle multiple elements in certain situations.
In general, the solution is to follow one of two approaches:
- Do we expect only a single item to be present? Then use the
only-element
operator. - Should we support multiple elements? Then use the
extract
operation to handle all of them, and reduce them to a single result according to the context, e.g., using theall = True
operation.
What is being released?
This release includes fixes for all cardinality-related errors detected by the DSL, which are listed below.
It also includes a related fix to the Qualify_CashAndSecurityTransfer
function, which is described in more detail below the list.
- The function
SecurityFinanceCashSettlementAmount
contained a multiplication of which one operand -securityQuantity
- was of multi cardinality. In practice, due to filtering, it should always be a single element, so this was fixed withonly-element
. - The function
ResolveSecurityFinanceBillingAmount
had a similar problem as in (1). - The function
Qualify_Repurchase
was performing anonly exists
operation on multipleprimitiveInstruction
s at once. Since a former check verified there is only one, this was fixed withonly-element
. - The function
Qualify_Shaping
had a similar problem as in (3). - The function
Qualify_PartialDelivery
was comparing two multi cardinality quantities. In practice, due to filtering, both should always be a single element, so this was fixed withonly-element
. - The function
Qualify_OnDemandPayment
had a similar problem as in (3). - The condition
SettlementPayout
of the typeTrade
was performing anonly exists
operation on multiplepayout
s at once. This was fixed by calling the existing functionSettlementPayoutOnlyExists
instead, which handles multiple payouts. - The function
Qualify_CashTransfer
was performing anonly exists
operation on multipleprimitiveInstruction
s at once. To resolve the ambiguity, the check is now performed on allprimitiveInstruction
s separately usingextract
. - The function
Qualify_OpenOfferClearedTrade
was performing anonly exists
operation on twoprimitiveInstruction
s at once. The check has been replaced with two equivalentexists
operations, one for each of the twoprimitiveInstruction
s. - The function
Qualify_Renegotiation
had a similar problem as in (8). - The function
Qualify_SecuritySettlement
was performing anonly exists
operation on an unsupported input, which always resulted inFalse
. This was fixed by replacing it with anexists
check instead. - The function
Qualify_ValuationUpdate
was performing anonly exists
operation on multipleprimitiveInstruction
s at once. Given that the specification requires only a single component to be present, this was fixed withonly-element
. - The function
CheckAgencyRating
was performing acontains
operation on two operands of single cardinality. The operation has been replaced with an equality check=
instead. - The function
CheckAssetType
had a similar problem as in (13). - The function
Qualify_EquityOption_PriceReturnBasicPerformance_SingleName
was performing anonly exists
operation on multiplepayout
s at once. Since a former check verified there is only one, this was fixed withonly-element
. - The function
Qualify_EquityOption_PriceReturnBasicPerformance_Index
had a similar problem as in (15). - The function
Qualify_EquityOption_PriceReturnBasicPerformance_Basket
had a similar problem as in (15). - The function
Qualify_ForeignExchange_VanillaOption
had a similar problem as in (15). - The condition
Basket
of the typeSettlementPayout
was performing anonly exists
operation on multiplebasketConstituent
s at once. To resolve the ambiguity, the check is now performed on allbasketConstituent
s separately usingextract
.
Due to the bug fix in the function Qualify_SecuritySettlement
, another bug in the function Qualify_CashAndSecurityTransfer
came to light. According to its specification, a business event should only be qualified as a CashAndSecurityTransfer
only if the cash and security move in the same direction - however, this was never actually checked. The check has been implemented
and three expectation files have been updated accordingly.
Review Directions
Please inspect the changes identified above for the functions and conditions in the Textual Viewer of the Rosetta platform.
The changes can also be reviewed in PR: #3294.