Skip to content

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

Open
seidewitz wants to merge 2 commits intomasterfrom
ST6RI-912
Open

ST6RI-912 Eliminate adding of "nonunique" property to metamodel#738
seidewitz wants to merge 2 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 toadd 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
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.

1 participant