|
Re: Rendering models programmatically [message #1733070 is a reply to message #1732717] |
Tue, 24 May 2016 08:32 |
|
Le 23/05/2016 à 14:39, Rick Bouten a écrit :
> Hi all,
Hello
>
> I am part of a team that is making a tool that supports the migration of
> meta-models in a (somewhat) user-friendly way. In this tool (which is an
> eclipse-plugin) we make use of both Edapt and Sirius and add own code to
> fulfill our needs.
>
> We however have stumbled upon a problem.
>
> We would like to have a perspective with four views in which renders are
> shown of the models to be migrated. Two of the metamodel (one
> pre-migration and one post-migration) and two of an example of an
> instance of this metamodel (one pre- and one post-migration).
>
> Now we know that it is possible to create dynamic instances of a
> metamodel in the same Eclipseinstance (which is necessary to be able to
> show all four renders in the same perspective), which gives us a .xmi
> file in which the model is stored. Another option is to install the
> metamodel as a plugin in the same instance of Eclipse in which the
> metamodel is defined to create an instance of that model in that way.
>
> We however don't know how to make a graphical representation (not a
> tree/hierarchical representation but with rectangles and arrows and the
> like) of this model programmatically. Preferably we would have some
> piece of code which either makes the view with the graphical
> representation in it directly or creates a file which one can open by
> double-click.
> We have looked at creating a generic viewpoint specification model to
> use for all this model rendering but this clearly isn't made to be
> generic and we didn't got this working. For our needs a single
> viewpoints specification would be sufficient.
>
> Does anybody have a suggestion how we could tackle this problem or give
> us some inspiration such that we ourselves could solve this? If anything
> is still unclear, feel free to ask.
Here below are suggestions.
To represent the metamodel with Sirius you need to define a single
viewpoint which manage *.ecore as model file extension. Note that
EcoreTools has already done the job and provide an enhanced vsm. [1]
Then to have model instances you could generate two plugin your
metamodel corresponding to each version of your meta-model. That
supposes that your have changed the nsURI of your metamodel.
Then you can define RepresentationDescription such as diagram in one or
many VSM to represent your models.
To summurize:
* 1 VSM for *.ecore which covers any version of your metamodel
* two versions of your metamodel with the corresponding generated
meta-model plugin
* 1 RepresentationDescripton(in one or many VSM) per model version to
represent your model.
I hope that will help.
>
> Kind regards,
> Rick Bouten
>
[1] https://www.eclipse.org/ecoretools/
Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Powered by
FUDForum. Page generated in 0.03461 seconds