Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Serializing Models with Temporary Attributes (Serializing Models with Temporary Attributes )
Serializing Models with Temporary Attributes [message #1697776] Mon, 08 June 2015 12:44 Go to next message
Eclipse UserFriend
Hello,

I have the following case: I am using ETL to transform an input model A conforming to a metamodel MA. The output model is expected to conform to a metamodel OMA, which is basically MA extended with some additional classes and properties. So, the purpose of the transformation is to enrich the input model A with some extra information. Later, I will use the output model as an input in some other transformation.

This case can be implemented in various ways. The two ways I consider at the moment (and my questions related to this) are the following:

1. Using on-the-fly attribute and class extension mechanism of EOL: "~" operator allows me to add on the fly attributes to the objects during the transformation. However, the question becomes how (or can) can I serialize these attributes on the output model of the transformation? So, when I have the output model, I want to have it as A with the additional attributes added.

2. Using an explicit OMA: I can have an explicit metamodel OMA. However, the output model will be almost the same A with some additional properties. This requires to copy A into output as it is, then extend it (output) with additional information during transformation. How do I do this copying everything?

Thank you for your answers.

[Updated on: Mon, 08 June 2015 12:44] by Moderator

Report message to a moderator

Re: Serializing Models with Temporary Attributes [message #1697878 is a reply to message #1697776] Tue, 09 June 2015 10:17 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

Hi Bugra,

The EOL extended attributes are not stored inside the EMF resource itself, but in an EOL-specific data structure that is only kept in memory while the EOL script is running. Therefore, I don't think you'll be able to serialize them straight away.

I would go for 2, personally. If you need to transform a model to a metamodel that is very similar to the original one with some differences, I'd suggest trying out Flock. It is designed for model migration between similar metamodels, and offers primitives for this sort of "almost copying" model transformations.

Kind regards,
Antonio
Re: Serializing Models with Temporary Attributes [message #1697962 is a reply to message #1697878] Tue, 09 June 2015 22:08 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for the reply, Antonio. Your answer really helped me. I go for option 2, then.

Now, I have a question regarding to Flock and ETL. I am planning to follow the following procedure:

- Step 1: I will use Flock to migrate the model A (conforming to MA) to the model B (conforming to the new metamodel OMA).

OMA includes only one additional class ED, which is contained (0 or more containment relationship) in one of the MA's classes. ED also includes some references to some classes in MA.

Question: If I just write an empty Flock file, I expect a migrated model B, which is exactly the same as A except the containment relationships include 0 elements. In other words, Flock copies everything and let the new property unset. Is it so?

- Step 2: I will use ETL to process B to fill in the extension (creating some instances of ED and setting/adding necessary references) and overwrite the source model (the source and target models are the same and is B).

Question: Can I do the Step 1 and 2 together without using Ant files for pipelining? In other words, I want to execute one run configuration with one input model (A) and I want to get an output model (B). The reason of this togetherness is to profile the performance.

Thank you very much again.

[Updated on: Tue, 09 June 2015 23:07] by Moderator

Report message to a moderator

Re: Serializing Models with Temporary Attributes [message #1698022 is a reply to message #1697962] Wed, 10 June 2015 12:52 Go to previous message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

I'm not sure if it will be enough for step 1 with an empty file. I think you'll need a "retype package" statement, from the old package to the new package. You shouldn't need anything else as long as all the source metamodel classes are named the same as those in the target metamodel.

As for combining 1+2: this is currently not possible with regular run configurations. You'll need to either use Ant or write your own plugin which does the same thing in Java code. An alternative, if your extension is simple enough (i.e. only needs to consider values from a single type at a time), you might want to specify explicit migration rules for the affected types which compute the extension in addition to doing the migration. This only works for simple extensions, though: Flock is not really designed for highly complex transformations.
Previous Topic:[EUnit] assertEqualModels fails on model with applied UML profile
Next Topic:[EWL] Metamodel of additional models not loaded in interim release
Goto Forum:
  


Current Time: Thu Apr 25 11:04:20 GMT 2024

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

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

Back to the top