Skip to content

Fix #89#317

Merged
samatstariongroup merged 1 commit into
developmentfrom
GH89
Jul 1, 2026
Merged

Fix #89#317
samatstariongroup merged 1 commit into
developmentfrom
GH89

Conversation

@samatstariongroup

@samatstariongroup samatstariongroup commented Jun 30, 2026

Copy link
Copy Markdown
Member

Fixes #89.

Implements the single stubbed derived-property computation in SysML2.NET/Extend/ActionDefinitionExtensions.cs.

Change

List<IActionUsage> ComputeAction(this IActionDefinition) previously threw NotSupportedException. It now implements the OCL derivation:

action = usage->selectByKind(ActionUsage)

as [.. actionDefinitionSubject.usage.OfType<IActionUsage>()], with an ArgumentNullException guard on the subject. This mirrors the existing CalculationDefinitionExtensions.ComputeCalculation implementation.

Ordering contract

Per the metamodel (ActionDefinition::action, constraint deriveActionDefinitionAction), action is derived, ordered and usage (inherited from Definition) is likewise derived, ordered. The implementation preserves this contract: OfType<IActionUsage>() enumerates the ordered usage list in source order and [.. ] materializes that order, so action follows usage's ordering. ActionUsage → OccurrenceUsage → Usage, so the selectByKind(ActionUsage) filter over usage : Usage [0..*] is well-formed.

Tests

SysML2.NET.Tests/Extend/ActionDefinitionExtensionsTestFixture.cs — the obsolete placeholder test (asserting NotSupportedException) is replaced with VerifyComputeAction covering:

  • null subject → ArgumentNullException
  • empty ActionDefinition → empty result
  • positive (ActionUsage returned) + negative (bare Usage filtered out)

Solution builds with 0 errors; the fixture passes (1/1).

@sonarqubecloud

Copy link
Copy Markdown

@samatstariongroup samatstariongroup merged commit fbfba9d into development Jul 1, 2026
8 checks passed
@samatstariongroup samatstariongroup deleted the GH89 branch July 1, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[|Feature]: Implement ActionDefinitionExtensions derived property computations

1 participant