Systems-Modeling / SysML-v2-Pilot-Implementation

Proof-of-concept pilot implementation of the SysML v2 textual notation and visualization
GNU Lesser General Public License v3.0
123 stars 24 forks source link

ST6RI-660 Generate normative XMI files for KerML and SysML abstract syntax #473

Closed seidewitz closed 1 year ago

seidewitz commented 1 year ago

This PR adds QVT transformations to produce .uml files supporting the generation of the normative KerML and SysML abstract syntax metamodel XMI files. The new transformations are based on the transformations that were already used to process the metamodel for use in the Pilot Implementation. The complete set of "metamodel preparation" transformations, which can be found in the org.omg.sysml/transform directory, are the following:

  1. PrepareMetamodel.qvto – Transforms the exported MOF metamodel to produce the SysML.uml file (in the model directory) used to generate the SysML.ecore file for the pilot implementation (and the SysML.json schema). Also the base transformation for the other transformations.
  2. PrepareMetamodelPackages.qvto – Produces the SysML.uml file (in the src/org/omg/sysml/generation directory). This is the same as the file produced by PrepareMetamodel, except that the elements are grouped into one level of sub-packages under the sysml model: Root, Core, Kernel and Systems.
  3. PrepareMetamodelKerMLSysML.qvto – Produces the KerML_only.uml and SysML_only.uml files (in the model directory). These contain, together, all the elements in SysML.uml, but divided between the KerML and SysML abstract syntax models (but with no further sub-packaging). (The KerML_only.uml file is used to generate the KerML.json schema.)
  4. PrepareMetamodelSysMLPackages.qvto (new) – Produces a .uml for the combined KerML and SysML abstract syntax, but with all levels of packaging from the original MOF model. Used to create an intermediate SysML_xmi.uml file. (See workflow below.)
  5. PrepareMetamodelKerMLSysMLPackages.qvto (new) – Produces separate .uml files for the KerML and SysML abstract syntax, with all levels of packaging from the original MOF model. The SysML file cross-references elements from the KerML file as necessary. Used to create the KerML_only_xmi.uml and SysML_only_xmi.uml files (ultimately in the model directory). (See workflow below.)

The workflow for preparing .uml files with normative XMI IDs is as follows:

  1. Export the MOF abstract syntax model from Magicdraw to .uml format in a temporary Export directory.
  2. Run PrepareMetamodelSysMLPackages using the Prepare Metamodel SysML Packages launch configuration, which generates the file SysML_xmi.uml in the Export directory.
  3. Open the SysML_xmi.uml file in the Eclipse UML Editor.
  4. Select the sysml model and run the command UML Editor > Convert To > Metamodel. (This creates the normative XMI IDs for both KerML and SysML, with consistent cross-references.)
  5. Select the sysml model and run the comment UML Editor > Package > Unapply Profile.
  6. Unapply the UML Standard Profile.
  7. Save SysML_xmi.uml.
  8. Run PrepareMetamodelKerMLSysMLPackages using the Prepare Metamodel KerML and SysML Packages launch configuration, which takes SysML_xmi.uml as input and generates KerML_only_xmi.uml and SysML_only_xmi.uml in the Export directory. (This generation must be done in the Export directory.)
  9. Edit KerML_only_xmi.uml and SysML_only_xmi.uml as XML to change the top-level model XMI IDs to _kerml and _sysml, respectively.
  10. Move KerML_only_xmi.uml and SysML_only_xmi.uml to the model directory.

The remaining steps for generating "clean" XMI from KerML_only_xmi.uml and SysML_only_xmi.uml are performed outside Eclipse.

This branch also includes the final KerML_only_xmi.uml and SysML_only_xmi.uml files used to create the normative XMI files for the fourth revised submission to OMG.

seidewitz commented 1 year ago

@YvesTLS @Weilkiti – For your information.