Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Cloning elements in ETL
Cloning elements in ETL [message #1070068] Wed, 17 July 2013 03:33 Go to next message
Alex G is currently offline Alex G
Messages: 96
Registered: January 2012
Member
Hi!

I have an EMF model and try clone elements in an ETL transformation by emfTool.ecoreUtil.copy(...). After cloning I of course add them a container.

There are ETL rules which shall handle the children of the newly created cloned elements. However these rules are not called.
If I on the other hand clone the objects manually, i.e. create

var x = new ModelName!Type

then the rules are called on "x", as expected.

Am I doing something completely wrong or is this behavior of ETL the actual state of affairs?

Best regards,
Alex.
Re: Cloning elements in ETL [message #1070074 is a reply to message #1070068] Wed, 17 July 2013 03:49 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 800
Registered: July 2009
Senior Member
Hi Alex,

Does this help?

http://www.eclipse.org/forums/index.php/mv/msg/489620/1067239/#msg_1067239

Cheers,
Dimitris
Re: Cloning elements in ETL [message #1070077 is a reply to message #1070068] Wed, 17 July 2013 03:51 Go to previous messageGo to next message
Alex G is currently offline Alex G
Messages: 96
Registered: January 2012
Member
I think I found here some solution:
The caching has to be disabled. I don't understand why, but it seems to work.

Is there another way by not disabling the cache and get the cloned elements automatically transformed (for reasons of performance)?


@Dimitris:
Your answer was some minutes faster Smile, thank you.

[Updated on: Wed, 17 July 2013 03:54]

Report message to a moderator

Re: Cloning elements in ETL [message #1070083 is a reply to message #1070077] Wed, 17 July 2013 04:02 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 800
Registered: July 2009
Senior Member
Hi Alex,

The caching policy assumes that all model elements are created/deleted via the new/delete keywords of EOL (which eventually delegate to the createInstance/deleteElement methods of [1] - you can see how caches are maintained there). When attaching new elements directly to the underlying resource, caches don't get updated accordingly, which causes the behaviour you're encountering. Is there any way you could break down your transformation into 2 steps (one for the cloning bit and one for the actual transformation) and then use the Epsilon ANT tasks to run these sequentially?

Cheers,
Dimitris

[1] https://dev.eclipse.org/svnroot/modeling/org.eclipse.epsilon/trunk/plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/models/CachedModel.java
Re: Cloning elements in ETL [message #1070093 is a reply to message #1070083] Wed, 17 July 2013 04:16 Go to previous messageGo to next message
Alex G is currently offline Alex G
Messages: 96
Registered: January 2012
Member
Hi Dimitris,

I of course could split the transformtion into more steps, but it would enlarge the maintenance for metamodel updates or extensions, since I would have to clone manually.
Sure I could add an intermediate cloned model (created by automatically ecore) and transform this, but in my case cloning and the real transformation are not sequentially applicable but have to be interleaved (because of recursive structures with dependencies).

Wouldn't it be easier to more generally immitate the cloning process in EOL directly, without using the emfTool.ecoreUtil (for the special case of EMF models)?

Best regards,
Alex.
Re: Cloning elements in ETL [message #1098054 is a reply to message #1070093] Fri, 30 August 2013 10:42 Go to previous message
Horacio Hoyos is currently offline Horacio Hoyos
Messages: 153
Registered: October 2009
Senior Member

I am facing a similar dilemma. I am thinking about a Flock + ETL solution. This might be helpful with your interleaved process. In my case most elements can be copied and slightly modified with Flock. But some of the elements require a more complex transformation. To make it more interesting I wished some of the attributes of a type could be copied and the rest modified... going crazy!

H


Horacio Hoyos Rodriguez
EngD Student
University Of York

[Updated on: Fri, 30 August 2013 10:44]

Report message to a moderator

Previous Topic:testing a transformation
Next Topic:[Epsilon Validation] : Newbie question
Goto Forum:
  


Current Time: Thu Jul 31 09:42:04 EDT 2014

Powered by FUDForum. Page generated in 0.03253 seconds