Skip to content

ST6RI-912 Eliminate adding of "nonunique" property to metamodel#738

Merged
seidewitz merged 3 commits intomasterfrom
ST6RI-912
Mar 1, 2026
Merged

ST6RI-912 Eliminate adding of "nonunique" property to metamodel#738
seidewitz merged 3 commits intomasterfrom
ST6RI-912

Conversation

@seidewitz
Copy link
Member

@seidewitz seidewitz commented Feb 15, 2026

This PR revises the Xtext grammars for KerML and SysML so that it is no longer to add the property Feature::isNonunique to the Ecore metamodel.

Background

The default for the Feature::isUnique property is true. In the textual notation, the nonunique keyword is used to set this property to false. However, the Xtext grammar ?= notation only supports setting a property to true on the parsing of a specific keyword.

The previous workaround for this was for the CustomUML2EcoreConverter to add an isNonunique property to Feature when generating the Ecore metamodel. The setting of this property was implemented to set isUnique to the opposite value. This allowed isNonunique ?= 'nonunique' to be used in the Xtext grammar.

Changes

  1. In each of the KerML and SysML Xtext grammars:
    • Add the production:
      Nonunique returns Ecore::EBoolean :
          'nonunique'
      ;
      
    • Change isNonunique ?= 'nonunique' to isUnique = Nonunique.
  2. Add package org.omg.kerml.xtext.conversion, with the Xtend classes:
    • KerMLValueConverterService – This is bound as the IValueConverterService in KerMLRuntimeModule.
    • NonuniqueValueConverter – This is the single provided value converter. It converts the value "nonunique" to false.
  3. Remove isNonunique property.
    • Update org.omg.sysml.importer.CustomUML2EcoreImporter to not add isNonunique to Feature.
    • Remove Feature_isNonunique_SettingDelegate.
    • Regenerate SysML.ecore and org.omg.sysml.lang.sysml.Feature.

- Added value converter so 'nonunique' keyword has the value "false" for
setting isUnique.

- Also updated KerMLOutlineTreeProvider to show "ordered" and
"nonunique" in outline entry for a feature.
- Removed Feature_isNonunique_SettingDelegate.
- Updated CustomUML2EcoreImporter to not add isNonunique.
@seidewitz seidewitz self-assigned this Feb 15, 2026
@seidewitz seidewitz added this to the 2026-02 milestone Feb 15, 2026
@seidewitz seidewitz requested a review from hpdekoning February 15, 2026 19:35
Copy link
Member

@hpdekoning hpdekoning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 All looks OK to me, apart from one silly typo, as reported.

@seidewitz seidewitz merged commit 2f73d82 into master Mar 1, 2026
2 checks passed
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.

2 participants