Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Access EMF Models(EMF Client Platform, QVTo)
Access EMF Models [message #1333145] Mon, 05 May 2014 00:57 Go to next message
Ioan Salau is currently offline Ioan SalauFriend
Messages: 69
Registered: July 2009
Location: Toronto
Member

I found EMF Client Platform very useful to create and edit EMF models collaboratively. However, I would be interested to use these models as input models for other tools like QVTo, Acceleo and so on. Let's consider following scenario:

Step 1. From "Model Explorer" provided by EMF Client Platform, I could create/edit an EMF model (i.e. bowling model), or you could check out an existing bowling model from CDO/EMFStore repositories.

Step 2. Under "Project Explorer", I will create a new QVTo Project and write a simple .qvto transformation that takes bowling model as input and as output I will have a different EMF model type.

What is the best way of providing the model created/edited on Step 1 as input parameter for transformation created on Step 2?

Option 1. Based on the samples provided by EMF Client Platform, I could load programmatically the bowling model and invoke programmatically QVTo transformation using TransformationExecutor.
Option 2. Used QVTo launch configuration (launchConfiguration type="org.eclipse.m2m.qvt.oml.QvtTransformation"), but this would require to set the URI of bowling model.

Question: How can I get access programmatically or via URI to the bowling model? Should I check out the bowling model to a local file resource (as .XMI), or I could use the local model from "Project Explorer"? What would be the URI of the bowling model checked out under Project Explorer? What if the bowling model is using cross-references to other models saved to CDO/EMFStore?

Thanks in advance for your feedback/info.

Regards,
Ioan
Re: Access EMF Models [message #1334563 is a reply to message #1333145] Mon, 05 May 2014 16:53 Go to previous messageGo to next message
Maximilian Koegel is currently offline Maximilian KoegelFriend
Messages: 253
Registered: July 2009
Senior Member
Hi Ioan,

I would suggest to export the model to an XMI file from ECP, either with
the EMF Resource API or with the UI. The result of the transformation
can be added to the ECP project again, just make sure to remove it from
potential resources it might already be connected to.
Hope this helps!

Cheers,
Maximilian


Am 05.05.2014 02:57, schrieb Ioan Salau:
> I found EMF Client Platform very useful to create and edit EMF models
> collaboratively. However, I would be interested to use these models as
> input models for other tools like QVTo, Acceleo and so on. Let's
> consider following scenario:
>
> Step 1. From "Model Explorer" provided by EMF Client Platform, I could
> create/edit an EMF model (i.e. bowling model), or you could check out an
> existing bowling model from CDO/EMFStore repositories.
> Step 2. Under "Project Explorer", I will create a new QVTo Project and
> write a simple .qvto transformation that takes bowling model as input
> and as output I will have a different EMF model type.
>
> What is the best way of providing the model created/edited on Step 1 as
> input parameter for transformation created on Step 2?
>
> Option 1. Based on the samples provided by EMF Client Platform, I
> could load programmatically the bowling model and invoke
> programmatically QVTo transformation using TransformationExecutor.
> Option 2. Used QVTo launch configuration (launchConfiguration
> type="org.eclipse.m2m.qvt.oml.QvtTransformation"), but this would
> require to set the URI of bowling model.
>
> Question: How can I get access programmatically or via URI to the
> bowling model? Should I check out the bowling model to a local file
> resource (as .XMI), or I could use the local model from "Project
> Explorer"? What would be the URI of the bowling model checked out under
> Project Explorer? What if the bowling model is using cross-references
> to other models saved to CDO/EMFStore?
>
> Thanks in advance for your feedback/info.
>
> Regards,
> Ioan


--
Maximilian Kögel

Get Professional Eclipse Support: http://eclipsesource.com/munich
Re: Access EMF Models [message #1337622 is a reply to message #1334563] Tue, 06 May 2014 23:36 Go to previous messageGo to next message
Ioan Salau is currently offline Ioan SalauFriend
Messages: 69
Registered: July 2009
Location: Toronto
Member

Thank you Maximilian

If I understand correctly, ECP is using a separate workspace (ESWorkspace) to manage nd track changes for a local project (ESLocalProject) which has a corresponding remote project (ESRemoteProject) inside EMFStore or CDO Server. Since my QVTo operates inside regular Eclipse Workspace, I need to export the model from ESLocalProject to Eclipse Workspace under a regular project as .XMI. Once I export the model to .XMI under regular Eclipse project, any further changes are not tracked automatically as it would be with the changes made when the model is under ESLocalProject. As per your suggestion, I could put in place following operations:
1. Before QVTo operations, export all my models from ESLocalProject to a regular Eclipse Project.
2. Any changes done manually to an model should be done under ESLocalProject so the tracking of changes is provided automatically by ESLocalProject.
3. Changes done via EMF tools (QVTo) are made on Eclipse regular Project followed by an import of the models to ESLocalProject.

The set of models I am working with are quite complex and I use cross references a lot. Do I have to do anything special to keep cross references intact during import/export operations?

Also, I have situations when a model is exported from ESLocalProject to Eclipse Project and modified. Is it possible to import back overriding the ESLocalProject corresponding model? If yes, are changes done under Eclipse Project collected as fine grained changes or is going to be one change, i.e. old root element replaced by new root element?

Thanks,

Ioan
Re: Access EMF Models [message #1338631 is a reply to message #1337622] Wed, 07 May 2014 09:50 Go to previous messageGo to next message
Maximilian Koegel is currently offline Maximilian KoegelFriend
Messages: 253
Registered: July 2009
Senior Member
Hi,

comments inline...

> If I understand correctly, ECP is using a separate workspace
> (ESWorkspace) to manage nd track changes for a local project
> (ESLocalProject) which has a corresponding remote project
> (ESRemoteProject) inside EMFStore or CDO Server. Since my QVTo operates
> inside regular Eclipse Workspace, I need to export the model from
> ESLocalProject to Eclipse Workspace under a regular project as .XMI.
> Once I export the model to .XMI under regular Eclipse project, any
> further changes are not tracked automatically as it would be with the
> changes made when the model is under ESLocalProject.
Yes this is correct.

> As per your
> suggestion, I could put in place following operations:
> 1. Before QVTo operations, export all my models from ESLocalProject to
> a regular Eclipse Project. 2. Any changes done manually to an model
> should be done under ESLocalProject so the tracking of changes is
> provided automatically by ESLocalProject. 3. Changes done via EMF
> tools (QVTo) are made on Eclipse regular Project followed by an import
> of the models to ESLocalProject.
>
> The set of models I am working with are quite complex and I use cross
> references a lot. Do I have to do anything special to keep cross
> references intact during import/export operations?
Are these cross-references within one project? Are the cross-referenced
EObjects part of the export?

> Also, I have situations when a model is exported from ESLocalProject to
> Eclipse Project and modified. Is it possible to import back overriding
> the ESLocalProject corresponding model?
Yes, by deleting the old content and adding the changed EObjects as new
content.

> If yes, are changes done under
> Eclipse Project collected as fine grained changes or is going to be one
> change, i.e. old root element replaced by new root element?
It would be one big change in this case. However you could probably
derive the changes before and after the import with EMFCompare and
convert the DiffModel to a ChangeDescription which you apply on the
contents of the project, so it would get recorded as fine-grained changes.

Cheers,
Maximilian

--
Maximilian Kögel

Get Professional Eclipse Support: http://eclipsesource.com/munich
Re: Access EMF Models [message #1340614 is a reply to message #1338631] Thu, 08 May 2014 05:29 Go to previous message
Ioan Salau is currently offline Ioan SalauFriend
Messages: 69
Registered: July 2009
Location: Toronto
Member

Thank you for your time and explanations Maximilian. In meantime, I was able to write a sample command which invokes programmatically an QVTo script using ECP API to get models directly from ESLocalProject. The QVTo script I used has an INOUT parameter model which basically updates the original model. It works without export/import to Eclipse Project as .xmi and the changes done by QVTo are captured as fine grained changes as per "History Browser" after I commit changes done by QVTo transformation. Now, I need to do some more research to see how cross references are handled. My intention is to use cross references within the same EMStore, possible multiple ESRemoteProjects.

Regards,

Ioan
Previous Topic:[EMFStore] UI controller problems
Next Topic:Was EEF 1.2 released with Kepler?
Goto Forum:
  


Current Time: Fri Feb 26 05:04:14 GMT 2021

Powered by FUDForum. Page generated in 0.03176 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top