Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Using [ETL] or [Flock] with files from different xtext grammars
icon5.gif  Using [ETL] or [Flock] with files from different xtext grammars [message #1327949] Fri, 02 May 2014 12:29 Go to next message
Mirjan Merruko is currently offline Mirjan MerrukoFriend
Messages: 5
Registered: April 2014
Location: Helsinki
Junior Member
Hi,

I have the following case :

1. I have an xtext grammar for a DSL
2. a plug-in based on this grammar has been distributed to a number of users who already have source files comforming to this grammar
3. My grammar changes slightly and that makes the source files generated previously invalid according to the new grammar and incompatible with a newer plug-in
4. As the grammars have a corresponding ecore model I thought that a way to provide a data migration utility would be to generate an EMF representation of the file conforming to the ecore metamodel generated using the old grammar and transform it to another EMF representation conforming to the ecore metamodel generated using the new grammar then use a flock module to execute a migration strategy

What I wanted to know is if there is a way to transform the source files that conform to the old grammar to source files that conform to the new grammar through ETL or Flock without having to deal with EMF, just by using the grammars and the instance files.

Forgive me if the question is rather stupid or outside the scope of ETL and Flock but I'm a total beginner in both Epsilon and Xtext.

Best Regards,
Mirjan

Re: Using [ETL] or [Flock] with files from different xtext grammars [message #1333494 is a reply to message #1327949] Mon, 05 May 2014 05:01 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2182
Registered: July 2009
Location: York, UK
Senior Member

Hi Mirjan,

Flock sounds like the right tool for this task. Please let us know if you have any further questions.

Cheers,
Dimitris
Re: Using [ETL] or [Flock] with files from different xtext grammars [message #1338858 is a reply to message #1333494] Wed, 07 May 2014 12:03 Go to previous messageGo to next message
Mirjan Merruko is currently offline Mirjan MerrukoFriend
Messages: 5
Registered: April 2014
Location: Helsinki
Junior Member
Thank you for your answer Dimitris,

I've stumbled upon two issues though that I could use some help. This might be of interest to wider audiences as well. I've got a GMF-based editor which stores the notation model and the domain model in the same file. The notation part will be removed by flock so I guess I have to deal with it by doing some pre-processing. From my understanding this is storing information from two different meta-models in the same file so Flock doesn't have a mechanism to deal with this.

What I would like to make sure is that the domain model-part is properly transformed and stored. In order to do that I have to add some extra save and load options as those found in the source code of the GMFResouceFactory (uses an XMI with extra options).

After checking the org.eclipse.epsilon.emc.emf.EmfXMIResource I couldn't find the spot where I can customize this. My first impression is that this can't be done through the StringProperties. Is this supported, or somehow at least possible?

Best Regards,
Mirjan
Re: Using [ETL] or [Flock] with files from different xtext grammars [message #1338978 is a reply to message #1338858] Wed, 07 May 2014 13:07 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2182
Registered: July 2009
Location: York, UK
Senior Member

Hi Mirjan,

Off the top of my head, one option would be to un-tick the read on load option in your EMF model (e.g. X) and then, in the pre section of your Flock transformation, call X.resource.load(<map with your options>). Could you please give this a go and let me know if it works for you?

Cheers,
Dimitris
Previous Topic:EOL: Loading model from a ResourceSet
Next Topic:EVL Validation and @gmf.link query
Goto Forum:
  


Current Time: Wed Sep 25 23:04:03 GMT 2024

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

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

Back to the top