Skip to content

Conversation

@seidewitz
Copy link
Member

@seidewitz seidewitz commented Nov 14, 2025

This PR fixes a bug which caused the method Definition::getDirectedUsage to always return the empty list for ActionDefinitions and ConstraintDefinitions even if they did, in fact, have directedFeatures that were Usages.

Cause

The method getDirectedUsage was implemented by a DefaultDerivedPropertySettingDelegate, returning a DerivedEObjectEList subsetting directedFeature for elements that are Usages. However, the property directedFeature is redefined as parameter for Behaviors, and ActionDefinition and ConstraintDefinition are kinds of Behavior. Because of this, the dynamic get for directedFeature in DerivedEObjectEList was not returning anything, because directedFeature was no longer a feature of the EClass.

Fix

Added an explicit Definition_directedUsage_SettingDelegate that extends DefaultPropertySettingDelegate and overrides the method basicGet to check if the owner is an instance of ActionDefinition or ConstraintDefinition. If so, then a DerivedEObjectEList is returned that derives from parameter instead of directedFeature. Otherwise, DefaultDerivedPropertySettingDelegate::basicGet is used.

- Handles ActionDefinitions and ConstraintDefinitions specially,
deriving "directedUsage" from "parameter" rather than "directedFeature".
@seidewitz seidewitz self-assigned this Nov 14, 2025
@seidewitz seidewitz added the bug Something isn't working label Nov 14, 2025
@seidewitz seidewitz modified the milestones: 2025-10, 2025-11 Nov 14, 2025
@seidewitz seidewitz merged commit 373cd4d into master Nov 19, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getDirectedUsage() returns null when we call it use some specific Definition elements.

2 participants