Conversation
- The extra "put" for TerminateActionUsageImpl_subaction replaced the correct implicit generalization for a TerminateActionUsag subaction. - Also added TerminateActionUsage to SysMLSpecializationTest.
- Fixed if test to correctly check specialization by seqResult. - Generalized if test so that result typing is added for any seqResult that does not have a Collection type.
- Also turned on tests for IncludeUseCaseUsage in SysMLSpecializationTest.
Satisfied in SuccessionAsUsageAdapter: - checkDecisionNodeOutgoingSuccessionSpecialization - checkMergeNodeIncomingSuccessionSpecialization
To more closely correspond to the OCL of the constraint checkFeatureChainExprssionSpecialization.
Also: - Turned on checkFlowDefinitionSpecialization test. - Fixed expected specialization for checkViewpointUsageSpecialization.
Proactively resolves issue SYSML21-309, so that an objective redefines a general type that is a feature chain whose featureTarget is a CaseUsage.
- For subtypes of ActionUsage other than StateUsage, this check is unnecessary, because the conditions it was used in only applied in cases in which the owningType was other than a StateDefinition or StateUsage.
TheKorpos
approved these changes
Jul 7, 2025
| FeatureUtil.chainFeatures(sourceParameter, sourceTarget)); | ||
| Feature sourceParameter = target.getOwnedFeature().stream(). | ||
| filter(param->param.getDirection() == FeatureDirectionKind.IN). | ||
| findFirst().orElse(null); |
Contributor
There was a problem hiding this comment.
We could use ifPresent on the Optional here
Member
Author
There was a problem hiding this comment.
Sure, but whenever I do that, it seems clunky to then have to call get() to get the actual value. I'm an old school "check for null" guy. 😉
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes additional bugs in the transformation code for satisfying semantic constraints from the KerML and SysML specifications, mostly as identified in
TODOannotations made in PR #665 (ST6RI-843).KerML
FeatureChainExpression– Updated the implementation of result typing inFeatureChainExpressionAdapterto more closely follow the OCL of the constraintcheckFeatureChainExpressionSpecialization.Flow– UpdatedFlowAdapaterto implement the implicit specialization oftransfersforFlowswith no ends, satisfying the constraintcheckFlowSpecializationand consistent withcheckFlowWithEndsSpecialization.IndexExpression– Fixed the implementation of result typing inIndexExpressionAdapter. Also revised it so that result typing is added in all cases in which the sequence type is not any kind ofCollections::Collection. (See also KERML11-69.)SysML
AnalysisCaseUsage– Added the missing instantiation forAnalysisCaseUsageAdapterto theElementAdapterFactory, which fixes the implicit specialization ofsubAnalysisCasesto satisfy the constraintcheckAnalysisCaseUsageSubAnalysisCaseSpecialization.IncludeUseCaseUsage– Fixed the implicit specialization ofincludedUseCasesinIncludeUseCaseUsageAdapter, satisfying the constraintcheckIncludeUseCaseSpecialization(which should be namedcheckIncludeUseCaseUsageSpecialization, see SYSML21-299).SuccessionAsUsage– Implemented implicit specialization inSuccessionAsUsageAdapterto satisfy the constraintscheckDecisionNodeOutgoingSuccessionSpecializationandcheckMergeNodeIncomingSuccessionSpecialization.TerminateActionUsage– Fixed the initialization of theImpliedGeneralizationMapso thatTerminateActionUsageImplhas the correct entry forsubaction.VerificationCaseUsage– Added the missing instantiation forVerificationCaseUsageAdapterto theElementAdapterFactory, which fixes the implicit specialization ofsubVerificationCasesto satisfy the constraintcheckVerificationCaseUsageSubVerificationCaseSpecialization.The PR also proactively resolves the issue
to avoid spurious validation errors when including a use case via a feature chain.