Conversation
- Also updated other tests to remove redundant KerML message that "Features must have at least one type".
- Only validated on unspecialized Usages and ReferenceUsages, because AttributeUsages and OccurrenceUsages (and their specializations) already have their own typing validations. - Also updated KerML validation so that the "Features must have at least one type" error only happens if there are no types at all, not filtering out invalid types.
geneShreve
approved these changes
Oct 29, 2025
geneShreve
approved these changes
Oct 29, 2025
|
So, I should switch back to master and retest.
Gene
Gene J. Shreve
Senior Systems Engineer
|
Member
Author
|
@geneShreve |
|
I did – understood.
Thanks for the help!
Gene
Gene J. Shreve
Senior Systems Engineer
Integration Innovation, Inc. (i3)
8000 Rideout Road SW, Suite 400
Huntsville, AL 35808
Mobile: 931-492-1951
[Image]
Confidentiality Notice - The information contained in this e-mail and any attachments to it may be legally privileged and include confidential information. If you are not the intended recipient, be aware that any disclosure, distribution or copying of this e-mail or its attachments is prohibited. If you have received this e-mail in error, please notify the sender immediately of that fact by return e-mail and permanently delete the e-mail and any attachments to it.
From: Ed Seidewitz ***@***.***>
Date: Wednesday, October 29, 2025 at 3:53 PM
To: Systems-Modeling/SysML-v2-Pilot-Implementation ***@***.***>
Cc: Gene Shreve ***@***.***>, Mention ***@***.***>
Subject: Re: [Systems-Modeling/SysML-v2-Pilot-Implementation] ST6RI-885 Usage should not be allowed to be typed by another usage (PR #707)
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
[Image removed by sender.]seidewitz left a comment (Systems-Modeling/SysML-v2-Pilot-Implementation#707)<#707 (comment)>
@geneShreve<https://github.com/geneShreve>
You should probably switch back to master. Whether you retest is up to you. No further approval is required.
—
Reply to this email directly, view it on GitHub<#707 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BBIFSZVSTIL753EBUYFQYRT32ESNFAVCNFSM6AAAAACKCKD3E2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTINRTHE3DEOBYG4>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
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 implements a specific validation check to disallow a usage from being typed by another usage.
Background
KerML allows a
Featureto by typed by any other kind ofType, including anotherFeature. However, in the SysML abstract syntax,Feature::typeis redefined byUsage::definitionsuch that alldefinitionsof aUsagemust beClassifiers(usually SysMLDefinitions). There were already validation checks implemented for specific kinds ofUsages(for example, that anOccurrenceUsagemust be typed byClasses, anItemUsagemust be typed byStructures, etc.). But there was previously no check implemented for the typing of aReferenceUsageor a generalUsagethat was not of a more specific kind.On the other hand, the implementation of
Usage::getDefinitionfilters out all types of aUsagethat were notClassifiers. Further,getTypeforUsageis delegated togetDefinition(or possibly an even more specific redefinition), so getting the the types of aUsagetyped by aFeatureinstead of aClassifierwould actually result in an empty list. So, previously, the following produced the confusing KerML validation error that "Features must have at least one type":On the other hand, the following did not produce any error at all:
This was because getting the types of
xfiltered out the invalid typing by the usagea, leaving only the valid typeA.Changes
This PR includes the following changes to resolve the problem identified above:
SysMLValidation::checkUsagethat all the "raw" types of aUsage(without filtering) areClassifiers. If the check fails, the error message is "A usage must be typed by definitions." The check is not performed if the usage is anAttributeUsageorOccurrenceUsage(or subclasses of those), because those kinds of usages already have more specific typing validation checks.KerMLValidation::checkFeatureonFeaturetyping so that it checks the "raw" types of aFeature, regardless of filtering that may be done in overrides of theType::getTypemethod. That is, the validation check only fails if theFeaturehas no types at all, even if some of the types it has are not actually valid per other checks. This prevents the a redundant "Features must have at least one type" error from being produced in addition to a more specific typing validation error.With these changes, both of the
ReferenceUsagedeclarations above produce (only) the error "A usage must be typed by definitions."