-
Notifications
You must be signed in to change notification settings - Fork 43
ST6RI-864 Additional semantic transformation bugs #669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
| FeatureUtil.chainFeatures(sourceParameter, sourceTarget)); | ||
| Feature sourceParameter = target.getOwnedFeature().stream(). | ||
| filter(param->param.getDirection() == FeatureDirectionKind.IN). | ||
| findFirst().orElse(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use ifPresent on the Optional here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 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.