Updating the Meta-Model

From AadlWiki

Jump to: navigation, search

The meta model is in the project org.osate.aadl2.metamodel. The XMI and ecore files are available on http://www.aadl.info/aadl/osate/osate-doc/metamodel/

The AADL meta-model is disseminated in the directories Core Language and Property Language. Here, you hav the model that should be designed by hand. Then, other files reference these file (such as AADL2.uml).

The following files are available

  • AADL2.EMF.merged.uml : UML model with the complete meta-model. It is created from AAD2.uml.
  • AADL2.EMF: contains the AADL meta-model with additional information related to EMF. In fact, this is a wrapper between EMF AND the AADL meta-model
  • AADL2.INSTANCE: meta-model for the instance model
  • AADL2.merged the complete AADL meta-model merged (all referenced files are then merged).
  • AADL2.uml : which pieces are merged to create the AADL2 meta-model. This model references the *real* AADL meta-model pieces in Core Language and Property Language directories.

To edit the UML meta-model, you need the UML editor from TOPCASED. We

To generate the ECORE meta-model from UML, follow the procedure:

  • In org.osate.aadl2 model directory
  • Click on aadl2.genmodel and Reload
  • Click on Next everytime


Contents

Updating the meta-model step by step

The AADL Meta-Model was written using the TOPCASED UML editor. If you would like to modify/change the AADL meta-model, you will then need the TOPCASED UML editor. This is only provided with TOPCASED. So, first thing before everything else: you need to download TOPCASED on http://www.topcased.org. You can also use the UML editor in the standalone Eclipse. Installation instruction could be found on http://wiki.edna-site.org/index.php/How_to_install_the_Topcased_UML_editor

Then, checkout the OSATE sources. You can edit separately the files in the directories Core Language and Property Language. Then, to reflect the changes into the AADL meta-model for EMF/ecore, you will need to regenerate the complete AADL meta-model, merge it and build the model with EMF information.

Regenerate the complete meta-model and EMF code

Step 0 (optional): Build the merged model

  1. Click on AADL2.uml in the package org.osate.aadl2.metamodel
  2. Select the first package (AADL2) in the first file (AADL2.uml)
  3. In the menu, choose UML Editor -> Package -> Merge and leave the default options. MAke sure the Redundant Generalizations are set to Discard.
  4. DO NOT SAVE THIS FILE, instead, after the merge, go to File and Save as the file AADL2.merged.uml

Important: the file AADL2.uml does not have to be saved and must stay as-it. Instead, the full meta-model will be in AADL2.merged.uml.

Step 1: Build the merged model with ecore information

  1. In the package org.osate.aadl2.metamodel, click on AADL2.EMF.uml
  2. Select the first package (AADL2) in the first file (AADL2.EMF.uml)
  3. In the menu, choose UML Editor -> Package -> Merge and leave the default options. MAke sure the Redundant Generalizations are set to Discard.
  4. Then, convert to a meta-model by Click on UML Editor -> Convert To -> Meta-model and keep the default options
  5. DO NOT SAVE THIS FILE, instead, after the merge, go to File and Save as the file AADL2.EMF.merged.uml

Important: the file AADL2.EMF.uml does not have to be saved and must stay as-it. Instead, the full meta-model will be in AADL2.EMF.merged.uml.


Step 2: Generate the ECORE model from UML

  1. In the package org.osate.aadl2, open the directory model
  2. Open the file aadl2.genmodel
  3. Make a right-click and select Reload. Keep the default options. It should take the UML model AADL2.EMF'merged.uml generated during step 2.


Step 3: Re-generate the Java meta-model code from ECORE

  1. In the package org.osate.aadl2, once you have generated the ecore model, select again the aadl2.genmodel
  2. Select the Aadl2 package and click the menu Generator and then, choose to generate the code you want (edit/model code)
  3. Code has then be generated, you have successfully updated the meta-model code !


Regenerating the instance code

When regenerating the instance model, make sure the Aadl2EditPlugin.java from org.osate.aadl2.provider contains the following code:

/** * Create the instance. * * * @generated NOT */ public Aadl2EditPlugin() { super(new ResourceLocator[] { EcoreEditPlugin.INSTANCE, UMLEditPlugin.INSTANCE, }); }

Personal tools