Using the OCLEditor with arbitrary EMF based meta-models

It is also possible creating OCL expressions on arbitrary meta-models which have to be EMF/MOF based. In this section you will create an OCL project at this level.

  1. add the new meta-model to the OCLEditor SQUAM preferences. Make sure that the meta-model has the file extension ".ecore" or ".xsd" (Window > Preferences > OCLEditor Community Edition > Metamodel > Add new metamodel). Select the meta-model in the FileDialog.

New OCL Library Project wizard

  1. select the new meta-model from the list, and finally select the adequate default context for OCL tests:

New OCL Library Project wizard       

Creating the project

  1. Inside Eclipse select the menu item File > New > Project.... to open the New Project wizard.
  2. Select OCL Library Project then click Next to start the New OCL Library Project wizard. Finally give the project a name.

    New OCL Library Project wizard

    On this page select the added meta-model as a standard meta-model and click Finish.

     

  3. Create a new OCL library newmetatest.oclx : File > New > Other > SQUAM > New OCL Library. Use templates(Strg + Space) to create basic OCL Library structure:

    Package explorer

    Select the new meta-model in the metamodel proposal of the template.

    Now everything is set in order to write OCL expressions on arbitrary meta-models.

     

Related reference

New OCL Library Project Wizard