Using Existing Files with a UMLX Editor

If your files already use one of the
  • KM3 Editor: *.km3, *.ecore, *.emof
  • OCL Editor: *.ocl, *.oclecore, *.oclemof
  • QVTcore Editor: *.qvtc, *.eqvtcore, *.qvtcore
  • QVTrelation Editor: *.qvtr (or *.qvt), *.eqvtrelation, *.eqvtrelation
    extensions, you should find that the corresponding editor is automatically available for use via Open With-> in the Package Explorer or Navigator views.

    You may change the editor file associations by Window->Preferences|General->Editors->File Associations so that your files can be edited directly.

    Model Binding

    Since your files may reference other models and since the UMLX editors perform semantic validation each model referencing failure may result in many errors. You must therefore use the Model Registry to make the referenced models resolvable within the editor.

    For the purpose of this discussion we assume that

  • you wish to edit a QVTr transformation in my/file.qvtr within your ModelProject project
  • the transformation refers to meta-models MM1 and MM2
  • the MM1 metamodel is available as model/meta-model1.xml within your MetaModelProject project.
  • the MM2 metamodel has been installed by an Eclipse plug-in as "http://meta-model2" in the EMF Package Registry, and that it was built with a *.ecore file in the same folder as its *.genmodel file.
  • [Since the UMLX Editors uses the Model Registry, the meta-models may be independently defined using EMOF or Ecore regardless of their file extension. The meta-model may even use a non-XML form if a suitable to-Ecore translator has been registered.]

    Step 1: Add QVTrelation Nature to the Model Project

    Select ModelProject and from the right button menu invoke UMLX Natures->Add QVTrelation Nature.

    [The QVTrelation Nature need only be added if you require automatic conversion of concrete to abstract syntax by a the UMLX builder.]

    Step 2: Add Model Registry Nature to the Model Project

    Select ModelProject and from the right button menu invoke UMLX Natures->Add Model Registry Nature.

    [The Model Registry Nature must be added for Model Registry Property Pages to be used.]

    Step 3: Bind Meta-Model References

    Invoke Properties, Model Registry from the right button menu of ModelProject to open up the Model Registry Property Page.

    In the Property Page for the Model Name Accessor, invoke New...
    Enter MM1, and use Browse Workspace... to locate MetaModelProject/model/meta-model1.xml.
    Hit OK to complete the binding.
    Repeat for MM2, using Browse Registered Packages... to locate http://meta-model2.

    Finally hit OK to complete the registrations.

    [If your meta-models use a non-XML format, you should select that format in the serialization combo.]

    [If the required bindings for MM1 and MM2 vary between project files, define the bindings for each file rather than for the project. If the bindings are common to all files in a folder, define the bindings for the folder rather than each file.]

    Step 4: Edit your files

    From the Eclipse main menu invoke Project->Clean... for ModelProject, and any errors should appear in the Problems View.

    You may double click my/file.qvtr or a problem marker to open the editor.