PCM Development/Updating generated GMF editors

Aus SDQ-Wiki

Short and incomplete list of things to do when updating generated GMF editors of the PCM after updating the metamodel. SEFF editor and Repository Editor can be regenerated; others in general shouldn't be regenerated due to manyfold manual changes.

Required Plugins

  • GMF 2.0.1
  • GMF Experimental SDK
    • The Trace plugin keeps the "Visual IDs" of elements after regenerating code/gmfgen files

Metamodel

In the metamodel, prefer renaming association / compositions to keeping them after changing the metamodel in that area (if semantics changed). This eases finded affected areas in model and editor code.

GMF-Models

GMF Models reside in /de.uka.ipd.sdq.pcm/model/. Most GMF model files are nowadays created manually. Do not derive them from the metamodel, instead adapt the existing files.

GMFGEN

  • Adapt GMFTOOL / GMFGRAPH / GMFMAP to include for example new metamodel elements and reflect other changes in the metamodel.
    • Using "Validate" on a top node in the GMFTOOL / GMFGRAPH / GMFMAP Model Editor helps to find inconsistencies to the PCM metamdel
  • Regenerate GMFGEN from GMFMAP ("Create generator model" in the context menu)
  • Check the newly generated and previous version of GMFGEN with a DIFF tool
    • Copy paste "behaviour"s from the old file to the new one (merge does not work in GMF for this sections)
    • Keep the "preference page"s block from the old version
    • In case Visual IDs are changed for metamodel elements that still exist but may have moved within the metamodel, keep the old Visual ID.
  • Generate GMF code ("Generate diagram code" in the context menu of GMFGEN)
    • The corresponding GMF plugins in the workspace now contain the new generated code and can be tested by running the project as "Eclipse Application"

Additional Code

Also have a look into the edit helpers projects of the particular editor. Play around with the editor after regenerating code before commiting it to the SVN. Often, edit helpers get overwritten.

When testing the GMF Editors, make sure the view "Error Log" is being displayed. Exceptions that occur because of errors in the new GMF editor code appear in this view.

Manually customized Editors

Allocation

Composite

EditHelper

pcm.editor

Keywords: GMFGMF, Editors, generate, PCMPCM