Skip to content

[2397] Display requirement derivations as edges in the General View - #2413

Merged
AxelRICHARD merged 1 commit into
eclipse-syson:mainfrom
kkkk1258999:kab/enh/requirement-derivation-edges
Aug 13, 2026
Merged

AxelRICHARD merged 1 commit into
eclipse-syson:mainfrom
kkkk1258999:kab/enh/requirement-derivation-edges

Conversation

@kkkk1258999

Copy link
Copy Markdown
Contributor

Fixes #2397

Follows the approach agreed in the issue: correct the shared connector-end resolution, then add a dedicated derivation edge.

Shared fix: connector end resolution
The ends declared with the end keyword inside a connection body are imported as plain FeatureMemberships owning a feature with isEnd = true, while getConnectorEnd() only collected the ends owned through an EndFeatureMembership. Every such end was filtered out, so connectorEnd, relatedFeature, sourceFeature and targetFeature were all empty.

KerML defines endFeature as the owned features having isEnd = true, an EndFeatureMembership being one syntactic form implying it, so both forms are now collected. The logic is duplicated between ConnectorImpl and ConnectorAsUsageImpl because of multiple inheritance, and both have been updated consistently.

Requirement derivation edge
SysML v2 has no dedicated metaclass for requirement derivation: it is a ConnectionUsage annotated with #derivation, or typed by DerivationConnections::Derivation. Three query services were added on MetamodelQueryElementService and exposed to AQL through ModelQueryAQLService:

isRequirementDerivation, recognizing both forms;
getDerivationOriginalEnd / getDerivationDerivedEnd, resolving the ends from the #original and #derive metadata they carry, falling back on the end order declared by DerivationConnections::Derivation when the ends are not annotated.
Resolving the ends from their metadata rather than from their declaration order keeps the direction correct whatever order the ends are written in.

RequirementDerivationEdgeDescriptionProvider renders the derivation from the derived requirement to the original one, as a dashed edge labelled «derive» with an arrow toward the original requirement, so it is distinguishable from the solid «satisfy» edge. Derivations are excluded from the generic ConnectionUsage edge precondition so a single edge is rendered.

Regression coverage
ConnectorEndTest (metamodel):

ends owned through EndFeatureMembership resolve;
ends owned through a plain FeatureMembership resolve;
an owned feature with isEnd = false is not returned as an end.
Each case checks connectorEnd, relatedFeature, sourceFeature and targetFeature.

MetamodelQueryElementServiceTest:

a #derivation connection is recognized, a plain one is not;
the ends are resolved from their metadata, including when the derived end is declared first;
the end order fallback applies when the ends carry no metadata.
GVRequirementDerivationEdgeTests (General View):

a derivation between two displayed requirements renders one edge, directed from the derived requirement to the original one, labelled «derive», dashed, with an arrow toward the original requirement;
the same model with the ends declared in the reverse order renders the same edge in the same direction;
exactly one visible edge is rendered and its description id is the derivation edge, so the generic connection edge does not duplicate it.

@kkkk1258999
kkkk1258999 force-pushed the kab/enh/requirement-derivation-edges branch from e991ddc to d52f2f4 Compare August 12, 2026 07:58
@AxelRICHARD AxelRICHARD added this to the 2026.9.0 milestone Aug 12, 2026
@AxelRICHARD

Copy link
Copy Markdown
Member

Hello @kkkk1258999, thank your for providing this PR.

SysON is an eclipse project and as such, you must sign the Eclipse ECA or I won't be able to merge this PR.

Otherwise, it seems you followed our commit messages formatting rules, that's great!

Regards,

@kkkk1258999
kkkk1258999 force-pushed the kab/enh/requirement-derivation-edges branch 3 times, most recently from 9e973cc to 9c031cc Compare August 12, 2026 15:03
Comment thread CHANGELOG.adoc Outdated
Comment thread CHANGELOG.adoc Outdated
Comment thread CHANGELOG.adoc Outdated
SysML v2 has no dedicated metaclass for requirement derivation: a derivation
is a ConnectionUsage annotated with the #derivation metadata of the
RequirementDerivation standard library, or typed by
DerivationConnections::Derivation. Nothing detected them, so they were never
rendered in the General View, unlike satisfy relations.

Displaying them also required fixing how the ends of a connector are
resolved. The ends declared with the "end" keyword inside a connection body
are imported as plain FeatureMemberships owning a feature with isEnd = true,
while getConnectorEnd() only collected the ends owned through an
EndFeatureMembership. Every such end was filtered out, leaving connectorEnd,
relatedFeature, sourceFeature and targetFeature empty. KerML defines
endFeature as the owned features having isEnd = true, an EndFeatureMembership
being one syntactic form implying it, so both forms are now collected. That
logic is duplicated between ConnectorImpl and ConnectorAsUsageImpl because of
multiple inheritance, and both are updated consistently.

Add three query services on MetamodelQueryElementService, exposed to AQL
through ModelQueryAQLService:

- isRequirementDerivation, which recognizes both forms of derivation;
- getDerivationOriginalEnd and getDerivationDerivedEnd, which resolve the ends
  from the #original and #derive metadata carried by them, and fall back on
  the end order declared by DerivationConnections::Derivation when the ends
  are not annotated.

Resolving the ends from their metadata rather than from their declaration
order keeps the edge direction correct whatever order the ends are written in.

Add RequirementDerivationEdgeDescriptionProvider, which renders a derivation
from the derived requirement to the original one as a dashed edge labelled
«derive» with an arrow toward the original requirement, so it can be told
apart from the solid «satisfy» edge. Requirement derivations are excluded from
the generic ConnectionUsage edge so that a single edge is displayed.

Only the display of existing derivations is covered here. Creating a
derivation from the diagram and n-ary derivations remain to be done.

Bug: eclipse-syson#2397
Signed-off-by: kkkk1258999 <fishing_kaba@yahoo.co.jp>
@kkkk1258999
kkkk1258999 force-pushed the kab/enh/requirement-derivation-edges branch from 9c031cc to 9041866 Compare August 13, 2026 03:10
@kkkk1258999

Copy link
Copy Markdown
Contributor Author

One note on the direct edit tool check that was failing: the «derive» label
is a constant, like «satisfy», «frame», «assume» and «require», so I kept the
edge without a direct edit tool and excluded it from the check instead, which
is how those edges are handled. I filtered it by description name rather than
by domain type, because the derivation edge shares its ConnectionUsage domain
type with the generic connection edge, whose label is the connection name and
must stay editable. Happy to add a direct edit tool instead if you prefer.

@AxelRICHARD

Copy link
Copy Markdown
Member

One note on the direct edit tool check that was failing: the «derive» label is a constant, like «satisfy», «frame», «assume» and «require», so I kept the edge without a direct edit tool and excluded it from the check instead, which is how those edges are handled. I filtered it by description name rather than by domain type, because the derivation edge shares its ConnectionUsage domain type with the generic connection edge, whose label is the connection name and must stay editable. Happy to add a direct edit tool instead if you prefer.

No, it's ok like that, thank you.

@AxelRICHARD

Copy link
Copy Markdown
Member

Thank you @kkkk1258999 for this contribution, we appreciate!

What would be great, is to provide (in a separate issue/PR) the edge tool allowing to create a derive Connection between two Requirements. If you have the time to do it, it would be great, if not it's ok I will do it at some point.

Thank you again.

Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[diagrams] Requirement derivations are not displayed as edges in the General View

2 participants