SysML-v2-Pilot-Implementation icon indicating copy to clipboard operation
SysML-v2-Pilot-Implementation copied to clipboard

ST6RI-899 getEnumeratedValue and getVariant broken on EnumerationDefinition

Open seidewitz opened this issue 1 month ago • 0 comments

This PR fixes a bug which caused the methods Definition::getVariant and EnumerationDefinition::getEnumeratedValue to always return the empty list for enumeration definitions, even if the enumeration definition did, in fact, have enumerated values.

Cause

The underlying cause was similar to the cause of the bug fixed in PR #712. The method getEnumeratedValue was implemented using a DerivedEObjectEList subsetting variant for elements that are EnumeationUsages'. However, the property enumeratedValueis a redefinition ofvariant, which prevented the dynamic get of variantin theDerivedEObjectEList` from working.

Changes

EnumerationDefinition_enumeratedValue_SettingDelegate – Revised to extend Definition_variant_SettingDelegate and explicitly filter the list produced for variant, rather than using DerivedEObjectEList.

Definition_directedUsage_SettingDelegate – Updated to use an implementation approach similar to that used in EnumerationDefinition_enumeratedValue_SettingDelegate (this is a revision to the approach implemented in PR #712).

Usage_directedUsage_SettingDelegate – Updated to also use an implementation approach similar to that used in EnumerationDefinition_enumeratedValue_SettingDelegate.

seidewitz avatar Dec 11 '25 18:12 seidewitz