Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Re: Copying models in ETL
Re: Copying models in ETL [message #1977] Tue, 11 November 2008 15:29 Go to next message
Eclipse UserFriend
Originally posted by: szchaler.acm.org

Hi again,

I have a core ecore metamodel and want to generate an extension
metamodel for this. This essentially means that I need to add a few
subclasses for some abstract classes in the core metamodel. As discussed
in earlier mails, I have a few tools that have problems with ecore
metamodels referencing each other. Hence, I cannot use linking between
the metamodels. Instead, I am planning to hack around this by including
a copy of all classes and relationships from the core metamodel in my
generated metamodel.

What is the most efficient way of creating such a copy?

Many thanks,

Steffen

Dimitrios Kolovos wrote:
> Hi Steffen,
>
> There are more than one ways to do this in ETL, EOL. Could you please
> give me a bit more details as to what you are trying to do so that I
> can suggest the best solution?
>
> I'd be grateful if we could take the discussion over to the
> eclipse.epsilon newsgroup as it sounds as something potentially
> interesting to others too (and also the more activity in the
> newsgroup, the better for the project ;)
>
> Cheers,
> Dimitrios
>
> Steffen Zschaler wrote:
>> Hi,
>>
>> Is there a possibility in ETL to create a copy of a source model to
>> be further expanded in the transformation?
>>
>> Many thanks,
>>
>> Steffen
Re: Copying models in ETL [message #2005 is a reply to message #1977] Tue, 11 November 2008 15:53 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000209080005090406070101
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Steffen,

I think that the most efficient way in your case is to load the two
metamodels in an EOL program, move the eClassifiers and eSubpackages of
the core metamodel to the extension metamodel and then save the
extension metamodel using a different name. E.g.

var coreEPackage := Core!EPackage.all.first();
var extEPackage := Ext!EPackage.all.first();

var coreClassifiers := coreEPackage.eClassifiers.clone();
var coreSubpackages := coreEPackage.eSubpackages.clone();

extEPackage.eClassifiers.addAll(coreClassifiers);
extEPackage.eSubpackages.addAll(coreSubpackages);

Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));

(just make sure you un-tick the Save on disposal checkbox when
specifying the models)

I've attached an example project (+launch configuration) that does this
on two minimal core and ext metamodels.

Hope this helps,
Dimitrios

Steffen Zschaler wrote:
> Hi again,
>
> I have a core ecore metamodel and want to generate an extension
> metamodel for this. This essentially means that I need to add a few
> subclasses for some abstract classes in the core metamodel. As discussed
> in earlier mails, I have a few tools that have problems with ecore
> metamodels referencing each other. Hence, I cannot use linking between
> the metamodels. Instead, I am planning to hack around this by including
> a copy of all classes and relationships from the core metamodel in my
> generated metamodel.
>
> What is the most efficient way of creating such a copy?
>
> Many thanks,
>
> Steffen
>
> Dimitrios Kolovos wrote:
>> Hi Steffen,
>>
>> There are more than one ways to do this in ETL, EOL. Could you please
>> give me a bit more details as to what you are trying to do so that I
>> can suggest the best solution?
>>
>> I'd be grateful if we could take the discussion over to the
>> eclipse.epsilon newsgroup as it sounds as something potentially
>> interesting to others too (and also the more activity in the
>> newsgroup, the better for the project ;)
>>
>> Cheers,
>> Dimitrios
>>
>> Steffen Zschaler wrote:
>>> Hi,
>>>
>>> Is there a possibility in ETL to create a copy of a source model to
>>> be further expanded in the transformation?
>>>
>>> Many thanks,
>>>
>>> Steffen


--------------000209080005090406070101
Content-Type: application/x-zip-compressed;
name="MergeMetamodels.zip"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="MergeMetamodels.zip"

UEsDBBQAAAAIACCFazkZDX08iAAAANsAAAAIAAAALnByb2plY3RVjkEOwiAQ RdeaeIeGvaI7
F5RujLuu1AMg/DSYMhCgxuPb1qphN+/9mZ8Rzcv11RMxWU81O+z2rAJpbyx1 Nbtdz9sja+Rm
LUL0D+h8QtLRhjxuj3YlSDnIFrFDi6ycN+iT4LOdYu2dA2Up+Hea7NKVZuAF 3Qfbm0uA/mQl
kspDxHL2h19F+dwbUEsDBBQAAAAIADaFazkVMWuC1QAAAFQBAAAKAAAAY29y ZS5lY29yZVWQ
ywrCMBBF94L/EGZvU+tGQqsLURAUxAe4DXFag01SmmLr3zuND2hWk7n3HmYm XXamZE+svXY2
g2kUA0Or3E3bIoPLeTOZw3IxHqWoXI1ifZDqIQtkndHin0ooNR4xegSzXpCY wb1pKsF527aR
M0Xk6oJf91v4WfzQ0s6CI4njKdl2J3VHIyfa+kZahQN6mGQQRlXqymMgoMl7 SsLXvQ2YlYbM
of5ArL8ct98OfQ415rrLABa9nOKqlN7rXNNujIYUzaui/Hf7IP6YK+D9Yfjw MtR6A1BLAwQU
AAAACAA1hWs5cbq1p0MAAABFAAAACAAAAGNvcmUuZW1mc8hLzE0tLkhMTtUo Lcq0VUrOL0pV
0lEoKEpNy6ywVVLS5OUCSmYnpqcqgKSsebl4uZJzEouLFZwVqnm5FBQUeLlq AVBLAwQUAAAA
CADUhWs5+4UWlecAAABpAQAACQAAAGV4dC5lY29yZVWQwWrDMBBE74H8g9ie YznupQgrOQQH
AimEJoFehbp2RC3JWGrt/n1XTlOwTmLnzbA75Xa0LfvGPhjvJKyzHBg67T+M ayRcL/vVC2w3
y0WJ2vcoqpPSn6pBNloj/l0FuZYLRo/CXBAkSrjF2AnOh2HIvG0y3zf8/fUA DyTMkeF5Ioo8
XxN2POsbWrUyLkTlNM7Sp01mZtSt6QJOCWjrlFLwKmHAnLIE4xj/Mly4vh3u A/qfeqzNKAE2
SS1x16oQTG3oMkYrivjTJff99kl8JFbU0/mrw/5CSJCQkCfOd8BTW3xeF41+ AVBLAwQUAAAA
CABXhWs5mYi7aFwAAABkAAAABwAAAGV4dC5lbWZzyEvMTS0uSExO1SgtyrRV Sq0oUdJRKChK
TcussFVS0uTlAsplJ6anKgBlrHm5eLkycwvyi0oUlJLzi1KVwCLJOYnFxQqu IBWpeSnFCiAZ
PWeFal4uBQUFXq5aAFBLAwQUAAAACAAdhms5S7zf6xYBAAAQAgAAEAAAAGV4 dC5tZXJnZWQu
ZWNvcmWdkVFLwzAUhd8F/0OIz1u6iiilcYxZobrh5jacTxLT2zbYpKXp1u7f m7RYrLAX38LN
Oec7N/GnjczQEUotckXxZOxgBIrnkVAJxbvt4+gOT+8vL3zgeQlesGL8iyWA Gim83uVal8lR
2jNzitOqKjxC6roe5zIZ52VC9suwl+ihpL5uFa7jTIxsseEpSDYSSldMcfhx tfyBD3gmCg2t
GWRsA1wSWBlu64mI4o/1y+FmtpiFQeSKt9un5fO72j+sMVJMmjRoKnPUu9ew P69KiEVDMTZL
I+TDPGNai1iYXZFp7lWnwhq712gv/9I+z9GCLtOmbg4FlFsTpVFqgBTbvCtC 5ph0XPIb/L8q
2TE4W6XjGMrgV83oG1BLAwQUAAAACAD8hWs54TAraqgAAAB6AQAAEgAAAE1l cmdlRXh0ZW5z
aW9uLmVvbHWPQQrCMBBF94XeIa6aguQAFhdS6lrwBGMyLcGpLUksPb4JQZmK 7jLz//t/soAT
enLYXUDfYUBxOIo2zrv3QgGR6q3zQdZNWSzRj2vg9m4N/9zZn/JbAu9tb9H5 xPBKxUWlaXrg
pyr5rs/bnJ0/UCYytCzYjdt8MOZEJL9uStAG4bkMYevcEz+vfIiKTK9xMkhn S6gczgQaZYUJ
q/aiGtENaFSe67p5AVBLAwQUAAAACAAbhms524muo3gBAAAXBAAAFQAAAE1l cmdlRXh0ZW5z
aW9uLmxhdW5jaNVTPW/CMBDdK/U/WEbq1jiBliLARS2ECcoCG4ubHMGqY0f2 hY9/XwMCAkxV
u3Sx7Lt37+6e9bq9Ta7ICqyTRnMaBSEloBOTSp1xOpsOH1uUOBQ6Fcpo4FQb 2nu9v+sqUepk
2Td6IbPSCvTlBLeFRxibBVA46fEBGBVAomThIEgxOBR56iA2anTLMAAFmUCg +w7S4RuilZ8l
AvmCLae5SUG5UzbWaLdkJVTp29YealGj44+wU5uWQD7MikQRiZrtp+d244X0 4ymph2HrDJNu
DCj2nEOp4F04SPlCKAdnjBY58L6xlZAFkU70yIiUoy0rCYceN9ED6QrjhLqm Ekr6Do6fI/mx
/cxKvkQs5m3G1uv1STIvJYN8wfzcdRYnF2PsxY7HwwrdcRPOxmAzOG3n2K7U s14QwKbw33q1
Q15VpDIqZT8VvdkOw9+IHm/wf2sOG/wDydmFDXYR5+86u3KGM6VNgB7/ZX41 zOHtJQW9M/rO
l0f6Wxf6+DdQSwECFAAUAAAACAAghWs5GQ19PIgAAADbAAAACAAAAAAAAAAB ACAAAAAAAAAA
LnByb2plY3RQSwECFAAUAAAACAA2hWs5FTFrgtUAAABUAQAACgAAAAAAAAAB ACAAAACuAAAA
Y29yZS5lY29yZVBLAQIUABQAAAAIADWFazlxurWnQwAAAEUAAAAIAAAAAAAA AAEAIAAAAKsB
AABjb3JlLmVtZlBLAQIUABQAAAAIANSFazn7hRaV5wAAAGkBAAAJAAAAAAAA AAEAIAAAABQC
AABleHQuZWNvcmVQSwECFAAUAAAACABXhWs5mYi7aFwAAABkAAAABwAAAAAA AAABACAAAAAi
AwAAZXh0LmVtZlBLAQIUABQAAAAIAB2GazlLvN/rFgEAABACAAAQAAAAAAAA AAEAIAAAAKMD
AABleHQubWVyZ2VkLmVjb3JlUEsBAhQAFAAAAAgA/IVrOeEwK2qoAAAAegEA ABIAAAAAAAAA
AQAgAAAA5wQAAE1lcmdlRXh0ZW5zaW9uLmVvbFBLAQIUABQAAAAIABuGaznb ia6jeAEAABcE
AAAVAAAAAAAAAAEAIAAAAL8FAABNZXJnZUV4dGVuc2lvbi5sYXVuY2hQSwUG AAAAAAgACADR
AQAAagcAAAAA
--------------000209080005090406070101--
Re: Copying models in ETL [message #2019 is a reply to message #2005] Tue, 11 November 2008 16:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: szchaler.acm.org

This is a multi-part message in MIME format.
--------------030005000309050801090702
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Dimitrios,

Thanks for the quick reply. I am actually generating ext. Would I be
able, then, to do this in the preamble of my ETL file, e.g.:

pre {
var coreEPackage := Core!EPackage.all.first();
var coreClassifiers := coreEPackage.eClassifiers.clone();
var coreSubpackages := coreEPackage.eSubpackages.clone();

var extEPackage := new Ext!EPackage;
extPackage.name := 'Bla';
extEPackage.eClassifiers.addAll(coreClassifiers);
extEPackage.eSubpackages.addAll(coreSubpackages);
}


Cheers,

Steffen

Dimitrios Kolovos wrote:
> Hi Steffen,
>
> I think that the most efficient way in your case is to load the two
> metamodels in an EOL program, move the eClassifiers and eSubpackages
> of the core metamodel to the extension metamodel and then save the
> extension metamodel using a different name. E.g.
>
> var coreEPackage := Core!EPackage.all.first();
> var extEPackage := Ext!EPackage.all.first();
>
> var coreClassifiers := coreEPackage.eClassifiers.clone();
> var coreSubpackages := coreEPackage.eSubpackages.clone();
>
> extEPackage.eClassifiers.addAll(coreClassifiers);
> extEPackage.eSubpackages.addAll(coreSubpackages);
>
> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>
> (just make sure you un-tick the Save on disposal checkbox when
> specifying the models)
>
> I've attached an example project (+launch configuration) that does
> this on two minimal core and ext metamodels.
>
> Hope this helps,
> Dimitrios
>
> Steffen Zschaler wrote:
>> Hi again,
>>
>> I have a core ecore metamodel and want to generate an extension
>> metamodel for this. This essentially means that I need to add a few
>> subclasses for some abstract classes in the core metamodel. As
>> discussed in earlier mails, I have a few tools that have problems
>> with ecore metamodels referencing each other. Hence, I cannot use
>> linking between the metamodels. Instead, I am planning to hack around
>> this by including a copy of all classes and relationships from the
>> core metamodel in my generated metamodel.
>>
>> What is the most efficient way of creating such a copy?
>>
>> Many thanks,
>>
>> Steffen
>>
>> Dimitrios Kolovos wrote:
>>> Hi Steffen,
>>>
>>> There are more than one ways to do this in ETL, EOL. Could you
>>> please give me a bit more details as to what you are trying to do so
>>> that I can suggest the best solution?
>>>
>>> I'd be grateful if we could take the discussion over to the
>>> eclipse.epsilon newsgroup as it sounds as something potentially
>>> interesting to others too (and also the more activity in the
>>> newsgroup, the better for the project ;)
>>>
>>> Cheers,
>>> Dimitrios
>>>
>>> Steffen Zschaler wrote:
>>>> Hi,
>>>>
>>>> Is there a possibility in ETL to create a copy of a source model to
>>>> be further expanded in the transformation?
>>>>
>>>> Many thanks,
>>>>
>>>> Steffen

--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
WWW http://www.steffen-zschaler.de/

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09


--------------030005000309050801090702
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Dimitrios,<br>
<br>
Thanks for the quick reply. I am actually generating ext. Would I be
able, then, to do this in the preamble of my ETL file, e.g.:<br>
<blockquote>
<pre>pre {
var coreEPackage := Core!EPackage.all.first();
var coreClassifiers := coreEPackage.eClassifiers.clone();
var coreSubpackages := coreEPackage.eSubpackages.clone();

var extEPackage := new Ext!EPackage;
extPackage.name := 'Bla';
extEPackage.eClassifiers.addAll(coreClassifiers);
extEPackage.eSubpackages.addAll(coreSubpackages);
}
</pre>
</blockquote>
Cheers,<br>
<br>
Steffen<br>
<br>
Dimitrios Kolovos wrote:
<blockquote cite="mid:gfc9pb$vev$1@build.eclipse.org" type="cite">Hi
Steffen,
<br>
<br>
I think that the most efficient way in your case is to load the two
metamodels in an EOL program, move the eClassifiers and eSubpackages of
the core metamodel to the extension metamodel and then save the
extension metamodel using a different name. E.g.
<br>
<br>
var coreEPackage := Core!EPackage.all.first();
<br>
var extEPackage := Ext!EPackage.all.first();
<br>
<br>
var coreClassifiers := coreEPackage.eClassifiers.clone();
<br>
var coreSubpackages := coreEPackage.eSubpackages.clone();
<br>
<br>
extEPackage.eClassifiers.addAll(coreClassifiers);
<br>
extEPackage.eSubpackages.addAll(coreSubpackages);
<br>
<br>
Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
<br>
<br>
(just make sure you un-tick the Save on disposal checkbox when
specifying the models)
<br>
<br>
I've attached an example project (+launch configuration) that does this
on two minimal core and ext metamodels.
<br>
<br>
Hope this helps,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi again,
<br>
<br>
I have a core ecore metamodel and want to generate an extension
metamodel for this. This essentially means that I need to add a few
subclasses for some abstract classes in the core metamodel. As
discussed in earlier mails, I have a few tools that have problems with
ecore metamodels referencing each other. Hence, I cannot use linking
between the metamodels. Instead, I am planning to hack around this by
including a copy of all classes and relationships from the core
metamodel in my generated metamodel.
<br>
<br>
What is the most efficient way of creating such a copy?
<br>
<br>
Many thanks,
<br>
<br>
Steffen
<br>
<br>
Dimitrios Kolovos wrote:
<br>
<blockquote type="cite">Hi Steffen,
<br>
<br>
There are more than one ways to do this in ETL, EOL. Could you please
give me a bit more details as to what you are trying to do so that I
can suggest the best solution?
<br>
<br>
I'd be grateful if we could take the discussion over to the
eclipse.epsilon newsgroup as it sounds as something potentially
interesting to others too (and also the more activity in the newsgroup,
the better for the project ;)
<br>
<br>
Cheers,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
Is there a possibility in ETL to create a copy of a source model to be
further expanded in the transformation?
<br>
<br>
Many thanks,
<br>
<br>
Steffen<br>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email <a class="moz-txt-link-abbreviated" href="mailto:szschaler@acm.org">szschaler@acm.org</a>
WWW <a class="moz-txt-link-freetext" href="http://www.steffen-zschaler.de/">http://www.steffen-zschaler.de/</a>

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
<a class="moz-txt-link-freetext" href="http://qosa.ipd.uka.de/">http://qosa.ipd.uka.de/</a>

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
<a class="moz-txt-link-freetext" href="http://wikiserver.sse.cs.tu-bs.de/mise09">http://wikiserver.sse.cs.tu-bs.de/mise09</a></pre>
</body>
</html>

--------------030005000309050801090702--
Re: Copying models in ETL [message #2047 is a reply to message #2019] Tue, 11 November 2008 16:23 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
I'd do this in the post section instead so that it runs after the ETL
rules. Otherwise the rules will have nothing to transform in the source
model. (Just make sure you don't store Core after the transformation is
done because by putting the classifiers and subpackages to ext you are
actually removing them from core).

Cheers,
Dimitrios

Steffen Zschaler wrote:
> Hi Dimitrios,
>
> Thanks for the quick reply. I am actually generating ext. Would I be
> able, then, to do this in the preamble of my ETL file, e.g.:
>
> pre {
> var coreEPackage := Core!EPackage.all.first();
> var coreClassifiers := coreEPackage.eClassifiers.clone();
> var coreSubpackages := coreEPackage.eSubpackages.clone();
>
> var extEPackage := new Ext!EPackage;
> extPackage.name := 'Bla';
> extEPackage.eClassifiers.addAll(coreClassifiers);
> extEPackage.eSubpackages.addAll(coreSubpackages);
> }
>
>
> Cheers,
>
> Steffen
>
> Dimitrios Kolovos wrote:
>> Hi Steffen,
>>
>> I think that the most efficient way in your case is to load the two
>> metamodels in an EOL program, move the eClassifiers and eSubpackages
>> of the core metamodel to the extension metamodel and then save the
>> extension metamodel using a different name. E.g.
>>
>> var coreEPackage := Core!EPackage.all.first();
>> var extEPackage := Ext!EPackage.all.first();
>>
>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>
>> extEPackage.eClassifiers.addAll(coreClassifiers);
>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>
>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>
>> (just make sure you un-tick the Save on disposal checkbox when
>> specifying the models)
>>
>> I've attached an example project (+launch configuration) that does
>> this on two minimal core and ext metamodels.
>>
>> Hope this helps,
>> Dimitrios
>>
>> Steffen Zschaler wrote:
>>> Hi again,
>>>
>>> I have a core ecore metamodel and want to generate an extension
>>> metamodel for this. This essentially means that I need to add a few
>>> subclasses for some abstract classes in the core metamodel. As
>>> discussed in earlier mails, I have a few tools that have problems
>>> with ecore metamodels referencing each other. Hence, I cannot use
>>> linking between the metamodels. Instead, I am planning to hack around
>>> this by including a copy of all classes and relationships from the
>>> core metamodel in my generated metamodel.
>>>
>>> What is the most efficient way of creating such a copy?
>>>
>>> Many thanks,
>>>
>>> Steffen
>>>
>>> Dimitrios Kolovos wrote:
>>>> Hi Steffen,
>>>>
>>>> There are more than one ways to do this in ETL, EOL. Could you
>>>> please give me a bit more details as to what you are trying to do so
>>>> that I can suggest the best solution?
>>>>
>>>> I'd be grateful if we could take the discussion over to the
>>>> eclipse.epsilon newsgroup as it sounds as something potentially
>>>> interesting to others too (and also the more activity in the
>>>> newsgroup, the better for the project ;)
>>>>
>>>> Cheers,
>>>> Dimitrios
>>>>
>>>> Steffen Zschaler wrote:
>>>>> Hi,
>>>>>
>>>>> Is there a possibility in ETL to create a copy of a source model to
>>>>> be further expanded in the transformation?
>>>>>
>>>>> Many thanks,
>>>>>
>>>>> Steffen
>
> --
> Dr. rer. nat. Steffen Zschaler
> Senior Research Associate
>
> Lancaster University
> Lancaster, United Kingdom
>
> Email szschaler@acm.org
> WWW http://www.steffen-zschaler.de/
>
> --
>
> Consider submitting to QoSA 2009, the 5th International Conference on
> the Quality of Software-Architectures.
> http://qosa.ipd.uka.de/
>
> Consider submitting to MiSE 2009, the 3rd International Workshop on
> Models in Software Engineering
> http://wikiserver.sse.cs.tu-bs.de/mise09
>
Re: Copying models in ETL [message #2089 is a reply to message #2047] Tue, 11 November 2008 16:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: szchaler.acm.org

Hi,

Thanks again. Not sure, I completely understand this. Why would there be
nothing to transform? The rules I am writing are not actually
transforming elements from Core, but rather are creating additional
elements based on information from a 'source' model. Am I right in
assuming that in this case I would be OK to do the copy in pre?

Cheers,

Steffen

Dimitrios Kolovos wrote:
> I'd do this in the post section instead so that it runs after the ETL
> rules. Otherwise the rules will have nothing to transform in the
> source model. (Just make sure you don't store Core after the
> transformation is done because by putting the classifiers and
> subpackages to ext you are actually removing them from core).
>
> Cheers,
> Dimitrios
>
> Steffen Zschaler wrote:
>> Hi Dimitrios,
>>
>> Thanks for the quick reply. I am actually generating ext. Would I be
>> able, then, to do this in the preamble of my ETL file, e.g.:
>>
>> pre {
>> var coreEPackage := Core!EPackage.all.first();
>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>
>> var extEPackage := new Ext!EPackage;
>> extPackage.name := 'Bla';
>> extEPackage.eClassifiers.addAll(coreClassifiers);
>> extEPackage.eSubpackages.addAll(coreSubpackages);
>> }
>>
>> Cheers,
>>
>> Steffen
>>
>> Dimitrios Kolovos wrote:
>>> Hi Steffen,
>>>
>>> I think that the most efficient way in your case is to load the two
>>> metamodels in an EOL program, move the eClassifiers and eSubpackages
>>> of the core metamodel to the extension metamodel and then save the
>>> extension metamodel using a different name. E.g.
>>>
>>> var coreEPackage := Core!EPackage.all.first();
>>> var extEPackage := Ext!EPackage.all.first();
>>>
>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>
>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>
>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>
>>> (just make sure you un-tick the Save on disposal checkbox when
>>> specifying the models)
>>>
>>> I've attached an example project (+launch configuration) that does
>>> this on two minimal core and ext metamodels.
>>>
>>> Hope this helps,
>>> Dimitrios
>>>
>>> Steffen Zschaler wrote:
>>>> Hi again,
>>>>
>>>> I have a core ecore metamodel and want to generate an extension
>>>> metamodel for this. This essentially means that I need to add a few
>>>> subclasses for some abstract classes in the core metamodel. As
>>>> discussed in earlier mails, I have a few tools that have problems
>>>> with ecore metamodels referencing each other. Hence, I cannot use
>>>> linking between the metamodels. Instead, I am planning to hack
>>>> around this by including a copy of all classes and relationships
>>>> from the core metamodel in my generated metamodel.
>>>>
>>>> What is the most efficient way of creating such a copy?
>>>>
>>>> Many thanks,
>>>>
>>>> Steffen
>>>>
>>>> Dimitrios Kolovos wrote:
>>>>> Hi Steffen,
>>>>>
>>>>> There are more than one ways to do this in ETL, EOL. Could you
>>>>> please give me a bit more details as to what you are trying to do
>>>>> so that I can suggest the best solution?
>>>>>
>>>>> I'd be grateful if we could take the discussion over to the
>>>>> eclipse.epsilon newsgroup as it sounds as something potentially
>>>>> interesting to others too (and also the more activity in the
>>>>> newsgroup, the better for the project ;)
>>>>>
>>>>> Cheers,
>>>>> Dimitrios
>>>>>
>>>>> Steffen Zschaler wrote:
>>>>>> Hi,
>>>>>>
>>>>>> Is there a possibility in ETL to create a copy of a source model
>>>>>> to be further expanded in the transformation?
>>>>>>
>>>>>> Many thanks,
>>>>>>
>>>>>> Steffen
>>
>> --
>> Dr. rer. nat. Steffen Zschaler
>> Senior Research Associate
>>
>> Lancaster University
>> Lancaster, United Kingdom
>>
>> Email szschaler@acm.org
>> WWW http://www.steffen-zschaler.de/
>>
>> --
>>
>> Consider submitting to QoSA 2009, the 5th International Conference on
>> the Quality of Software-Architectures.
>> http://qosa.ipd.uka.de/
>>
>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>> Models in Software Engineering
>> http://wikiserver.sse.cs.tu-bs.de/mise09

--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
WWW http://www.steffen-zschaler.de/

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09
Re: Copying models in ETL [message #3110 is a reply to message #2089] Tue, 11 November 2008 16:35 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Oh! I made the assumption that your source model would be Core. Since it
is not, putting the code either in pre or post should be fine.

Cheers,
Dimitrios

Steffen Zschaler wrote:
> Hi,
>
> Thanks again. Not sure, I completely understand this. Why would there be
> nothing to transform? The rules I am writing are not actually
> transforming elements from Core, but rather are creating additional
> elements based on information from a 'source' model. Am I right in
> assuming that in this case I would be OK to do the copy in pre?
>
> Cheers,
>
> Steffen
>
> Dimitrios Kolovos wrote:
>> I'd do this in the post section instead so that it runs after the ETL
>> rules. Otherwise the rules will have nothing to transform in the
>> source model. (Just make sure you don't store Core after the
>> transformation is done because by putting the classifiers and
>> subpackages to ext you are actually removing them from core).
>>
>> Cheers,
>> Dimitrios
>>
>> Steffen Zschaler wrote:
>>> Hi Dimitrios,
>>>
>>> Thanks for the quick reply. I am actually generating ext. Would I be
>>> able, then, to do this in the preamble of my ETL file, e.g.:
>>>
>>> pre {
>>> var coreEPackage := Core!EPackage.all.first();
>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>
>>> var extEPackage := new Ext!EPackage;
>>> extPackage.name := 'Bla';
>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>> }
>>> Cheers,
>>>
>>> Steffen
>>>
>>> Dimitrios Kolovos wrote:
>>>> Hi Steffen,
>>>>
>>>> I think that the most efficient way in your case is to load the two
>>>> metamodels in an EOL program, move the eClassifiers and eSubpackages
>>>> of the core metamodel to the extension metamodel and then save the
>>>> extension metamodel using a different name. E.g.
>>>>
>>>> var coreEPackage := Core!EPackage.all.first();
>>>> var extEPackage := Ext!EPackage.all.first();
>>>>
>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>
>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>
>>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>>
>>>> (just make sure you un-tick the Save on disposal checkbox when
>>>> specifying the models)
>>>>
>>>> I've attached an example project (+launch configuration) that does
>>>> this on two minimal core and ext metamodels.
>>>>
>>>> Hope this helps,
>>>> Dimitrios
>>>>
>>>> Steffen Zschaler wrote:
>>>>> Hi again,
>>>>>
>>>>> I have a core ecore metamodel and want to generate an extension
>>>>> metamodel for this. This essentially means that I need to add a few
>>>>> subclasses for some abstract classes in the core metamodel. As
>>>>> discussed in earlier mails, I have a few tools that have problems
>>>>> with ecore metamodels referencing each other. Hence, I cannot use
>>>>> linking between the metamodels. Instead, I am planning to hack
>>>>> around this by including a copy of all classes and relationships
>>>>> from the core metamodel in my generated metamodel.
>>>>>
>>>>> What is the most efficient way of creating such a copy?
>>>>>
>>>>> Many thanks,
>>>>>
>>>>> Steffen
>>>>>
>>>>> Dimitrios Kolovos wrote:
>>>>>> Hi Steffen,
>>>>>>
>>>>>> There are more than one ways to do this in ETL, EOL. Could you
>>>>>> please give me a bit more details as to what you are trying to do
>>>>>> so that I can suggest the best solution?
>>>>>>
>>>>>> I'd be grateful if we could take the discussion over to the
>>>>>> eclipse.epsilon newsgroup as it sounds as something potentially
>>>>>> interesting to others too (and also the more activity in the
>>>>>> newsgroup, the better for the project ;)
>>>>>>
>>>>>> Cheers,
>>>>>> Dimitrios
>>>>>>
>>>>>> Steffen Zschaler wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> Is there a possibility in ETL to create a copy of a source model
>>>>>>> to be further expanded in the transformation?
>>>>>>>
>>>>>>> Many thanks,
>>>>>>>
>>>>>>> Steffen
>>>
>>> --
>>> Dr. rer. nat. Steffen Zschaler
>>> Senior Research Associate
>>>
>>> Lancaster University
>>> Lancaster, United Kingdom
>>>
>>> Email szschaler@acm.org
>>> WWW http://www.steffen-zschaler.de/
>>>
>>> --
>>>
>>> Consider submitting to QoSA 2009, the 5th International Conference on
>>> the Quality of Software-Architectures.
>>> http://qosa.ipd.uka.de/
>>>
>>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>>> Models in Software Engineering
>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>
Re: Copying models in ETL [message #3143 is a reply to message #3110] Tue, 11 November 2008 16:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: szchaler.acm.org

Thanks,

Steffen

Dimitrios Kolovos wrote:
> Oh! I made the assumption that your source model would be Core. Since
> it is not, putting the code either in pre or post should be fine.
>
> Cheers,
> Dimitrios
>
> Steffen Zschaler wrote:
>> Hi,
>>
>> Thanks again. Not sure, I completely understand this. Why would there
>> be nothing to transform? The rules I am writing are not actually
>> transforming elements from Core, but rather are creating additional
>> elements based on information from a 'source' model. Am I right in
>> assuming that in this case I would be OK to do the copy in pre?
>>
>> Cheers,
>>
>> Steffen
>>
>> Dimitrios Kolovos wrote:
>>> I'd do this in the post section instead so that it runs after the
>>> ETL rules. Otherwise the rules will have nothing to transform in the
>>> source model. (Just make sure you don't store Core after the
>>> transformation is done because by putting the classifiers and
>>> subpackages to ext you are actually removing them from core).
>>>
>>> Cheers,
>>> Dimitrios
>>>
>>> Steffen Zschaler wrote:
>>>> Hi Dimitrios,
>>>>
>>>> Thanks for the quick reply. I am actually generating ext. Would I
>>>> be able, then, to do this in the preamble of my ETL file, e.g.:
>>>>
>>>> pre {
>>>> var coreEPackage := Core!EPackage.all.first();
>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>
>>>> var extEPackage := new Ext!EPackage;
>>>> extPackage.name := 'Bla';
>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>> }
>>>> Cheers,
>>>>
>>>> Steffen
>>>>
>>>> Dimitrios Kolovos wrote:
>>>>> Hi Steffen,
>>>>>
>>>>> I think that the most efficient way in your case is to load the
>>>>> two metamodels in an EOL program, move the eClassifiers and
>>>>> eSubpackages of the core metamodel to the extension metamodel and
>>>>> then save the extension metamodel using a different name. E.g.
>>>>>
>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>> var extEPackage := Ext!EPackage.all.first();
>>>>>
>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>
>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>
>>>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>>>
>>>>> (just make sure you un-tick the Save on disposal checkbox when
>>>>> specifying the models)
>>>>>
>>>>> I've attached an example project (+launch configuration) that does
>>>>> this on two minimal core and ext metamodels.
>>>>>
>>>>> Hope this helps,
>>>>> Dimitrios
>>>>>
>>>>> Steffen Zschaler wrote:
>>>>>> Hi again,
>>>>>>
>>>>>> I have a core ecore metamodel and want to generate an extension
>>>>>> metamodel for this. This essentially means that I need to add a
>>>>>> few subclasses for some abstract classes in the core metamodel.
>>>>>> As discussed in earlier mails, I have a few tools that have
>>>>>> problems with ecore metamodels referencing each other. Hence, I
>>>>>> cannot use linking between the metamodels. Instead, I am planning
>>>>>> to hack around this by including a copy of all classes and
>>>>>> relationships from the core metamodel in my generated metamodel.
>>>>>>
>>>>>> What is the most efficient way of creating such a copy?
>>>>>>
>>>>>> Many thanks,
>>>>>>
>>>>>> Steffen
>>>>>>
>>>>>> Dimitrios Kolovos wrote:
>>>>>>> Hi Steffen,
>>>>>>>
>>>>>>> There are more than one ways to do this in ETL, EOL. Could you
>>>>>>> please give me a bit more details as to what you are trying to
>>>>>>> do so that I can suggest the best solution?
>>>>>>>
>>>>>>> I'd be grateful if we could take the discussion over to the
>>>>>>> eclipse.epsilon newsgroup as it sounds as something potentially
>>>>>>> interesting to others too (and also the more activity in the
>>>>>>> newsgroup, the better for the project ;)
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Dimitrios
>>>>>>>
>>>>>>> Steffen Zschaler wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Is there a possibility in ETL to create a copy of a source
>>>>>>>> model to be further expanded in the transformation?
>>>>>>>>
>>>>>>>> Many thanks,
>>>>>>>>
>>>>>>>> Steffen
>>>>
>>>> --
>>>> Dr. rer. nat. Steffen Zschaler
>>>> Senior Research Associate
>>>>
>>>> Lancaster University
>>>> Lancaster, United Kingdom
>>>>
>>>> Email szschaler@acm.org
>>>> WWW http://www.steffen-zschaler.de/
>>>>
>>>> --
>>>>
>>>> Consider submitting to QoSA 2009, the 5th International Conference on
>>>> the Quality of Software-Architectures.
>>>> http://qosa.ipd.uka.de/
>>>>
>>>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>>>> Models in Software Engineering
>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>


--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
WWW http://www.steffen-zschaler.de/

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09
Re: Copying models in ETL [message #3377 is a reply to message #3110] Wed, 12 November 2008 11:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: szchaler.acm.org

This is a multi-part message in MIME format.
--------------090907000804080207050102
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

It seems I'm still doing something wrong here. Here's the code I put
into pre:

pre {
var coreEPackage := Core!EPackage.all.first();
var coreClassifiers := coreEPackage.eClassifiers.clone();
var coreSubpackages := coreEPackage.eSubpackages.clone();

-- Copy Core Metamodel
var extEPackage := new target!EPackage;
extPackage.name := 'Bla';
extEPackage.eClassifiers.addAll(coreClassifiers);
extEPackage.eSubpackages.addAll(coreSubpackages);
}


However, all I get is an empty resulting model.

Any ideas where the error could be?

Steffen

Dimitrios Kolovos wrote:
> Oh! I made the assumption that your source model would be Core. Since
> it is not, putting the code either in pre or post should be fine.
>
> Cheers,
> Dimitrios
>
> Steffen Zschaler wrote:
>> Hi,
>>
>> Thanks again. Not sure, I completely understand this. Why would there
>> be nothing to transform? The rules I am writing are not actually
>> transforming elements from Core, but rather are creating additional
>> elements based on information from a 'source' model. Am I right in
>> assuming that in this case I would be OK to do the copy in pre?
>>
>> Cheers,
>>
>> Steffen
>>
>> Dimitrios Kolovos wrote:
>>> I'd do this in the post section instead so that it runs after the
>>> ETL rules. Otherwise the rules will have nothing to transform in the
>>> source model. (Just make sure you don't store Core after the
>>> transformation is done because by putting the classifiers and
>>> subpackages to ext you are actually removing them from core).
>>>
>>> Cheers,
>>> Dimitrios
>>>
>>> Steffen Zschaler wrote:
>>>> Hi Dimitrios,
>>>>
>>>> Thanks for the quick reply. I am actually generating ext. Would I
>>>> be able, then, to do this in the preamble of my ETL file, e.g.:
>>>>
>>>> pre {
>>>> var coreEPackage := Core!EPackage.all.first();
>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>
>>>> var extEPackage := new Ext!EPackage;
>>>> extPackage.name := 'Bla';
>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>> }
>>>> Cheers,
>>>>
>>>> Steffen
>>>>
>>>> Dimitrios Kolovos wrote:
>>>>> Hi Steffen,
>>>>>
>>>>> I think that the most efficient way in your case is to load the
>>>>> two metamodels in an EOL program, move the eClassifiers and
>>>>> eSubpackages of the core metamodel to the extension metamodel and
>>>>> then save the extension metamodel using a different name. E.g.
>>>>>
>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>> var extEPackage := Ext!EPackage.all.first();
>>>>>
>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>
>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>
>>>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>>>
>>>>> (just make sure you un-tick the Save on disposal checkbox when
>>>>> specifying the models)
>>>>>
>>>>> I've attached an example project (+launch configuration) that does
>>>>> this on two minimal core and ext metamodels.
>>>>>
>>>>> Hope this helps,
>>>>> Dimitrios
>>>>>
>>>>> Steffen Zschaler wrote:
>>>>>> Hi again,
>>>>>>
>>>>>> I have a core ecore metamodel and want to generate an extension
>>>>>> metamodel for this. This essentially means that I need to add a
>>>>>> few subclasses for some abstract classes in the core metamodel.
>>>>>> As discussed in earlier mails, I have a few tools that have
>>>>>> problems with ecore metamodels referencing each other. Hence, I
>>>>>> cannot use linking between the metamodels. Instead, I am planning
>>>>>> to hack around this by including a copy of all classes and
>>>>>> relationships from the core metamodel in my generated metamodel.
>>>>>>
>>>>>> What is the most efficient way of creating such a copy?
>>>>>>
>>>>>> Many thanks,
>>>>>>
>>>>>> Steffen
>>>>>>
>>>>>> Dimitrios Kolovos wrote:
>>>>>>> Hi Steffen,
>>>>>>>
>>>>>>> There are more than one ways to do this in ETL, EOL. Could you
>>>>>>> please give me a bit more details as to what you are trying to
>>>>>>> do so that I can suggest the best solution?
>>>>>>>
>>>>>>> I'd be grateful if we could take the discussion over to the
>>>>>>> eclipse.epsilon newsgroup as it sounds as something potentially
>>>>>>> interesting to others too (and also the more activity in the
>>>>>>> newsgroup, the better for the project ;)
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Dimitrios
>>>>>>>
>>>>>>> Steffen Zschaler wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Is there a possibility in ETL to create a copy of a source
>>>>>>>> model to be further expanded in the transformation?
>>>>>>>>
>>>>>>>> Many thanks,
>>>>>>>>
>>>>>>>> Steffen
>>>>
>>>> --
>>>> Dr. rer. nat. Steffen Zschaler
>>>> Senior Research Associate
>>>>
>>>> Lancaster University
>>>> Lancaster, United Kingdom
>>>>
>>>> Email szschaler@acm.org
>>>> WWW http://www.steffen-zschaler.de/
>>>>
>>>> --
>>>>
>>>> Consider submitting to QoSA 2009, the 5th International Conference on
>>>> the Quality of Software-Architectures.
>>>> http://qosa.ipd.uka.de/
>>>>
>>>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>>>> Models in Software Engineering
>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>

--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
WWW http://www.steffen-zschaler.de/

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09


--------------090907000804080207050102
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
It seems I'm still doing something wrong here. Here's the code I put
into pre:<br>
<blockquote>
<pre>pre {
var coreEPackage := Core!EPackage.all.first();
var coreClassifiers := coreEPackage.eClassifiers.clone();
var coreSubpackages := coreEPackage.eSubpackages.clone();

-- Copy Core Metamodel
var extEPackage := new target!EPackage;
extPackage.name := 'Bla';
extEPackage.eClassifiers.addAll(coreClassifiers);
extEPackage.eSubpackages.addAll(coreSubpackages);
}
</pre>
</blockquote>
However, all I get is an empty resulting model.<br>
<br>
Any ideas where the error could be?<br>
<br>
Steffen<br>
<br>
Dimitrios Kolovos wrote:
<blockquote cite="mid:gfcc9j$pj0$3@build.eclipse.org" type="cite">Oh! I
made the assumption that your source model would be Core. Since it is
not, putting the code either in pre or post should be fine.
<br>
<br>
Cheers,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
Thanks again. Not sure, I completely understand this. Why would there
be nothing to transform? The rules I am writing are not actually
transforming elements from Core, but rather are creating additional
elements based on information from a 'source' model. Am I right in
assuming that in this case I would be OK to do the copy in pre?
<br>
<br>
Cheers,
<br>
<br>
Steffen
<br>
<br>
Dimitrios Kolovos wrote:
<br>
<blockquote type="cite">I'd do this in the post section instead so
that it runs after the ETL rules. Otherwise the rules will have nothing
to transform in the source model. (Just make sure you don't store Core
after the transformation is done because by putting the classifiers and
subpackages to ext you are actually removing them from core).
<br>
<br>
Cheers,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi Dimitrios,
<br>
<br>
Thanks for the quick reply. I am actually generating ext. Would I be
able, then, to do this in the preamble of my ETL file, e.g.:
<br>
<br>
&nbsp;&nbsp;&nbsp; pre {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var coreEPackage := Core!EPackage.all.first();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var coreClassifiers := coreEPackage.eClassifiers.clone();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var coreSubpackages := coreEPackage.eSubpackages.clone();
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var extEPackage := new Ext!EPackage;
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extPackage.name := 'Bla';
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extEPackage.eClassifiers.addAll(coreClassifiers);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extEPackage.eSubpackages.addAll(coreSubpackages);
<br>
&nbsp;&nbsp;&nbsp; }
<br>
&nbsp;&nbsp;&nbsp;&nbsp; Cheers,
<br>
<br>
Steffen
<br>
<br>
Dimitrios Kolovos wrote:
<br>
<blockquote type="cite">Hi Steffen,
<br>
<br>
I think that the most efficient way in your case is to load the two
metamodels in an EOL program, move the eClassifiers and eSubpackages of
the core metamodel to the extension metamodel and then save the
extension metamodel using a different name. E.g.
<br>
<br>
var coreEPackage := Core!EPackage.all.first();
<br>
var extEPackage := Ext!EPackage.all.first();
<br>
<br>
var coreClassifiers := coreEPackage.eClassifiers.clone();
<br>
var coreSubpackages := coreEPackage.eSubpackages.clone();
<br>
<br>
extEPackage.eClassifiers.addAll(coreClassifiers);
<br>
extEPackage.eSubpackages.addAll(coreSubpackages);
<br>
<br>
Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
<br>
<br>
(just make sure you un-tick the Save on disposal checkbox when
specifying the models)
<br>
<br>
I've attached an example project (+launch configuration) that does this
on two minimal core and ext metamodels.
<br>
<br>
Hope this helps,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi again,
<br>
<br>
I have a core ecore metamodel and want to generate an extension
metamodel for this. This essentially means that I need to add a few
subclasses for some abstract classes in the core metamodel. As
discussed in earlier mails, I have a few tools that have problems with
ecore metamodels referencing each other. Hence, I cannot use linking
between the metamodels. Instead, I am planning to hack around this by
including a copy of all classes and relationships from the core
metamodel in my generated metamodel.
<br>
<br>
What is the most efficient way of creating such a copy?
<br>
<br>
Many thanks,
<br>
<br>
Steffen
<br>
<br>
Dimitrios Kolovos wrote:
<br>
<blockquote type="cite">Hi Steffen,
<br>
<br>
There are more than one ways to do this in ETL, EOL. Could you please
give me a bit more details as to what you are trying to do so that I
can suggest the best solution?
<br>
<br>
I'd be grateful if we could take the discussion over to the
eclipse.epsilon newsgroup as it sounds as something potentially
interesting to others too (and also the more activity in the newsgroup,
the better for the project ;)
<br>
<br>
Cheers,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
Is there a possibility in ETL to create a copy of a source model to be
further expanded in the transformation?
<br>
<br>
Many thanks,
<br>
<br>
Steffen
<br>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<br>
--&nbsp;<br>
Dr. rer. nat. Steffen Zschaler
<br>
Senior Research Associate
<br>
<br>
Lancaster University
<br>
Lancaster, United Kingdom
<br>
<br>
Email <a class="moz-txt-link-abbreviated" href="mailto:szschaler@acm.org">szschaler@acm.org</a>
<br>
WWW&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="http://www.steffen-zschaler.de/">http://www.steffen-zschaler.de/</a>
<br>
<br>
--&nbsp;<br>
<br>
Consider submitting to QoSA 2009, the 5th International Conference on
<br>
the Quality of Software-Architectures.
<br>
<a class="moz-txt-link-freetext" href="http://qosa.ipd.uka.de/">http://qosa.ipd.uka.de/</a>
<br>
<br>
Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
<br>
<a class="moz-txt-link-freetext" href="http://wikiserver.sse.cs.tu-bs.de/mise09">http://wikiserver.sse.cs.tu-bs.de/mise09</a>
<br>
</blockquote>
</blockquote>
<br>
</blockquote>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email <a class="moz-txt-link-abbreviated" href="mailto:szschaler@acm.org">szschaler@acm.org</a>
WWW <a class="moz-txt-link-freetext" href="http://www.steffen-zschaler.de/">http://www.steffen-zschaler.de/</a>

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
<a class="moz-txt-link-freetext" href="http://qosa.ipd.uka.de/">http://qosa.ipd.uka.de/</a>

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
<a class="moz-txt-link-freetext" href="http://wikiserver.sse.cs.tu-bs.de/mise09">http://wikiserver.sse.cs.tu-bs.de/mise09</a></pre>
</body>
</html>

--------------090907000804080207050102--
Re: Copying models in ETL [message #3481 is a reply to message #3377] Wed, 12 November 2008 13:13 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Steffen,

The only thing that comes to mind is that you don't store target when
the transformation ends. Could you please add a few print statements after

extEPackage.eSubpackages.addAll(coreSubpackages);

to see the state of your model once the statements above have executed?

e.g.

extEPackage.eClassifiers.println();

If the problem persists, could you please send me your transformation
and involved models/metamodels so that I can investigate more?

Cheers,
Dimitrios

Steffen Zschaler wrote:
> Hi,
>
> It seems I'm still doing something wrong here. Here's the code I put
> into pre:
>
> pre {
> var coreEPackage := Core!EPackage.all.first();
> var coreClassifiers := coreEPackage.eClassifiers.clone();
> var coreSubpackages := coreEPackage.eSubpackages.clone();
>
> -- Copy Core Metamodel
> var extEPackage := new target!EPackage;
> extPackage.name := 'Bla';
> extEPackage.eClassifiers.addAll(coreClassifiers);
> extEPackage.eSubpackages.addAll(coreSubpackages);
> }
>
>
> However, all I get is an empty resulting model.
>
> Any ideas where the error could be?
>
> Steffen
>
> Dimitrios Kolovos wrote:
>> Oh! I made the assumption that your source model would be Core. Since
>> it is not, putting the code either in pre or post should be fine.
>>
>> Cheers,
>> Dimitrios
>>
>> Steffen Zschaler wrote:
>>> Hi,
>>>
>>> Thanks again. Not sure, I completely understand this. Why would there
>>> be nothing to transform? The rules I am writing are not actually
>>> transforming elements from Core, but rather are creating additional
>>> elements based on information from a 'source' model. Am I right in
>>> assuming that in this case I would be OK to do the copy in pre?
>>>
>>> Cheers,
>>>
>>> Steffen
>>>
>>> Dimitrios Kolovos wrote:
>>>> I'd do this in the post section instead so that it runs after the
>>>> ETL rules. Otherwise the rules will have nothing to transform in the
>>>> source model. (Just make sure you don't store Core after the
>>>> transformation is done because by putting the classifiers and
>>>> subpackages to ext you are actually removing them from core).
>>>>
>>>> Cheers,
>>>> Dimitrios
>>>>
>>>> Steffen Zschaler wrote:
>>>>> Hi Dimitrios,
>>>>>
>>>>> Thanks for the quick reply. I am actually generating ext. Would I
>>>>> be able, then, to do this in the preamble of my ETL file, e.g.:
>>>>>
>>>>> pre {
>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>
>>>>> var extEPackage := new Ext!EPackage;
>>>>> extPackage.name := 'Bla';
>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>> }
>>>>> Cheers,
>>>>>
>>>>> Steffen
>>>>>
>>>>> Dimitrios Kolovos wrote:
>>>>>> Hi Steffen,
>>>>>>
>>>>>> I think that the most efficient way in your case is to load the
>>>>>> two metamodels in an EOL program, move the eClassifiers and
>>>>>> eSubpackages of the core metamodel to the extension metamodel and
>>>>>> then save the extension metamodel using a different name. E.g.
>>>>>>
>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>> var extEPackage := Ext!EPackage.all.first();
>>>>>>
>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>
>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>>
>>>>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>>>>
>>>>>> (just make sure you un-tick the Save on disposal checkbox when
>>>>>> specifying the models)
>>>>>>
>>>>>> I've attached an example project (+launch configuration) that does
>>>>>> this on two minimal core and ext metamodels.
>>>>>>
>>>>>> Hope this helps,
>>>>>> Dimitrios
>>>>>>
>>>>>> Steffen Zschaler wrote:
>>>>>>> Hi again,
>>>>>>>
>>>>>>> I have a core ecore metamodel and want to generate an extension
>>>>>>> metamodel for this. This essentially means that I need to add a
>>>>>>> few subclasses for some abstract classes in the core metamodel.
>>>>>>> As discussed in earlier mails, I have a few tools that have
>>>>>>> problems with ecore metamodels referencing each other. Hence, I
>>>>>>> cannot use linking between the metamodels. Instead, I am planning
>>>>>>> to hack around this by including a copy of all classes and
>>>>>>> relationships from the core metamodel in my generated metamodel.
>>>>>>>
>>>>>>> What is the most efficient way of creating such a copy?
>>>>>>>
>>>>>>> Many thanks,
>>>>>>>
>>>>>>> Steffen
>>>>>>>
>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>> Hi Steffen,
>>>>>>>>
>>>>>>>> There are more than one ways to do this in ETL, EOL. Could you
>>>>>>>> please give me a bit more details as to what you are trying to
>>>>>>>> do so that I can suggest the best solution?
>>>>>>>>
>>>>>>>> I'd be grateful if we could take the discussion over to the
>>>>>>>> eclipse.epsilon newsgroup as it sounds as something potentially
>>>>>>>> interesting to others too (and also the more activity in the
>>>>>>>> newsgroup, the better for the project ;)
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>> Dimitrios
>>>>>>>>
>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> Is there a possibility in ETL to create a copy of a source
>>>>>>>>> model to be further expanded in the transformation?
>>>>>>>>>
>>>>>>>>> Many thanks,
>>>>>>>>>
>>>>>>>>> Steffen
>>>>>
>>>>> --
>>>>> Dr. rer. nat. Steffen Zschaler
>>>>> Senior Research Associate
>>>>>
>>>>> Lancaster University
>>>>> Lancaster, United Kingdom
>>>>>
>>>>> Email szschaler@acm.org
>>>>> WWW http://www.steffen-zschaler.de/
>>>>>
>>>>> --
>>>>>
>>>>> Consider submitting to QoSA 2009, the 5th International Conference on
>>>>> the Quality of Software-Architectures.
>>>>> http://qosa.ipd.uka.de/
>>>>>
>>>>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>>>>> Models in Software Engineering
>>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>>
>
> --
> Dr. rer. nat. Steffen Zschaler
> Senior Research Associate
>
> Lancaster University
> Lancaster, United Kingdom
>
> Email szschaler@acm.org
> WWW http://www.steffen-zschaler.de/
>
> --
>
> Consider submitting to QoSA 2009, the 5th International Conference on
> the Quality of Software-Architectures.
> http://qosa.ipd.uka.de/
>
> Consider submitting to MiSE 2009, the 3rd International Workshop on
> Models in Software Engineering
> http://wikiserver.sse.cs.tu-bs.de/mise09
>
Re: Copying models in ETL [message #3578 is a reply to message #3481] Wed, 12 November 2008 13:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: szchaler.acm.org

Hi,

No output at all from println statement (even from something like
'Test'.println()). So it seems like I am making a mistake in setting up
the actual transformation and the transformation is never run.

Cheers,

Steffen

Dimitrios Kolovos wrote:
> Hi Steffen,
>
> The only thing that comes to mind is that you don't store target when
> the transformation ends. Could you please add a few print statements
> after
>
> extEPackage.eSubpackages.addAll(coreSubpackages);
>
> to see the state of your model once the statements above have executed?
>
> e.g.
>
> extEPackage.eClassifiers.println();
>
> If the problem persists, could you please send me your transformation
> and involved models/metamodels so that I can investigate more?
>
> Cheers,
> Dimitrios
>
> Steffen Zschaler wrote:
>> Hi,
>>
>> It seems I'm still doing something wrong here. Here's the code I put
>> into pre:
>>
>> pre {
>> var coreEPackage := Core!EPackage.all.first();
>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>
>> -- Copy Core Metamodel
>> var extEPackage := new target!EPackage;
>> extPackage.name := 'Bla';
>> extEPackage.eClassifiers.addAll(coreClassifiers);
>> extEPackage.eSubpackages.addAll(coreSubpackages);
>> }
>>
>> However, all I get is an empty resulting model.
>>
>> Any ideas where the error could be?
>>
>> Steffen
>>
>> Dimitrios Kolovos wrote:
>>> Oh! I made the assumption that your source model would be Core.
>>> Since it is not, putting the code either in pre or post should be fine.
>>>
>>> Cheers,
>>> Dimitrios
>>>
>>> Steffen Zschaler wrote:
>>>> Hi,
>>>>
>>>> Thanks again. Not sure, I completely understand this. Why would
>>>> there be nothing to transform? The rules I am writing are not
>>>> actually transforming elements from Core, but rather are creating
>>>> additional elements based on information from a 'source' model. Am
>>>> I right in assuming that in this case I would be OK to do the copy
>>>> in pre?
>>>>
>>>> Cheers,
>>>>
>>>> Steffen
>>>>
>>>> Dimitrios Kolovos wrote:
>>>>> I'd do this in the post section instead so that it runs after the
>>>>> ETL rules. Otherwise the rules will have nothing to transform in
>>>>> the source model. (Just make sure you don't store Core after the
>>>>> transformation is done because by putting the classifiers and
>>>>> subpackages to ext you are actually removing them from core).
>>>>>
>>>>> Cheers,
>>>>> Dimitrios
>>>>>
>>>>> Steffen Zschaler wrote:
>>>>>> Hi Dimitrios,
>>>>>>
>>>>>> Thanks for the quick reply. I am actually generating ext. Would I
>>>>>> be able, then, to do this in the preamble of my ETL file, e.g.:
>>>>>>
>>>>>> pre {
>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>
>>>>>> var extEPackage := new Ext!EPackage;
>>>>>> extPackage.name := 'Bla';
>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>> }
>>>>>> Cheers,
>>>>>>
>>>>>> Steffen
>>>>>>
>>>>>> Dimitrios Kolovos wrote:
>>>>>>> Hi Steffen,
>>>>>>>
>>>>>>> I think that the most efficient way in your case is to load the
>>>>>>> two metamodels in an EOL program, move the eClassifiers and
>>>>>>> eSubpackages of the core metamodel to the extension metamodel
>>>>>>> and then save the extension metamodel using a different name. E.g.
>>>>>>>
>>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>>> var extEPackage := Ext!EPackage.all.first();
>>>>>>>
>>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>>
>>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>>>
>>>>>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>>>>>
>>>>>>> (just make sure you un-tick the Save on disposal checkbox when
>>>>>>> specifying the models)
>>>>>>>
>>>>>>> I've attached an example project (+launch configuration) that
>>>>>>> does this on two minimal core and ext metamodels.
>>>>>>>
>>>>>>> Hope this helps,
>>>>>>> Dimitrios
>>>>>>>
>>>>>>> Steffen Zschaler wrote:
>>>>>>>> Hi again,
>>>>>>>>
>>>>>>>> I have a core ecore metamodel and want to generate an extension
>>>>>>>> metamodel for this. This essentially means that I need to add a
>>>>>>>> few subclasses for some abstract classes in the core metamodel.
>>>>>>>> As discussed in earlier mails, I have a few tools that have
>>>>>>>> problems with ecore metamodels referencing each other. Hence, I
>>>>>>>> cannot use linking between the metamodels. Instead, I am
>>>>>>>> planning to hack around this by including a copy of all classes
>>>>>>>> and relationships from the core metamodel in my generated
>>>>>>>> metamodel.
>>>>>>>>
>>>>>>>> What is the most efficient way of creating such a copy?
>>>>>>>>
>>>>>>>> Many thanks,
>>>>>>>>
>>>>>>>> Steffen
>>>>>>>>
>>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>>> Hi Steffen,
>>>>>>>>>
>>>>>>>>> There are more than one ways to do this in ETL, EOL. Could you
>>>>>>>>> please give me a bit more details as to what you are trying to
>>>>>>>>> do so that I can suggest the best solution?
>>>>>>>>>
>>>>>>>>> I'd be grateful if we could take the discussion over to the
>>>>>>>>> eclipse.epsilon newsgroup as it sounds as something
>>>>>>>>> potentially interesting to others too (and also the more
>>>>>>>>> activity in the newsgroup, the better for the project ;)
>>>>>>>>>
>>>>>>>>> Cheers,
>>>>>>>>> Dimitrios
>>>>>>>>>
>>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> Is there a possibility in ETL to create a copy of a source
>>>>>>>>>> model to be further expanded in the transformation?
>>>>>>>>>>
>>>>>>>>>> Many thanks,
>>>>>>>>>>
>>>>>>>>>> Steffen
>>>>>>
>>>>>> --
>>>>>> Dr. rer. nat. Steffen Zschaler
>>>>>> Senior Research Associate
>>>>>>
>>>>>> Lancaster University
>>>>>> Lancaster, United Kingdom
>>>>>>
>>>>>> Email szschaler@acm.org
>>>>>> WWW http://www.steffen-zschaler.de/
>>>>>>
>>>>>> --
>>>>>>
>>>>>> Consider submitting to QoSA 2009, the 5th International
>>>>>> Conference on
>>>>>> the Quality of Software-Architectures.
>>>>>> http://qosa.ipd.uka.de/
>>>>>>
>>>>>> Consider submitting to MiSE 2009, the 3rd International Workshop
>>>>>> on Models in Software Engineering
>>>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>>>
>>
>> --
>> Dr. rer. nat. Steffen Zschaler
>> Senior Research Associate
>>
>> Lancaster University
>> Lancaster, United Kingdom
>>
>> Email szschaler@acm.org
>> WWW http://www.steffen-zschaler.de/
>>
>> --
>>
>> Consider submitting to QoSA 2009, the 5th International Conference on
>> the Quality of Software-Architectures.
>> http://qosa.ipd.uka.de/
>>
>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>> Models in Software Engineering
>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>

--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
WWW http://www.steffen-zschaler.de/

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09
Re: Copying models in ETL [message #3611 is a reply to message #3481] Wed, 12 November 2008 13:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: szchaler.acm.org

:-( It seems I found another stupid mistake one can make in using
Epsilon. I used module.parse ("path_to_ETL_file") and then went on from
there. Debugging shows me that this seems to try and interpret
"path_to_ETL_file" as the actual ETL code instead of the name of the
file. Unfortunately, it didn't give me any error messages or exceptions
but just silently ignored any problems involved and left me with an
empty ETL module.

Cheers,

Steffen

Dimitrios Kolovos wrote:
> Hi Steffen,
>
> The only thing that comes to mind is that you don't store target when
> the transformation ends. Could you please add a few print statements
> after
>
> extEPackage.eSubpackages.addAll(coreSubpackages);
>
> to see the state of your model once the statements above have executed?
>
> e.g.
>
> extEPackage.eClassifiers.println();
>
> If the problem persists, could you please send me your transformation
> and involved models/metamodels so that I can investigate more?
>
> Cheers,
> Dimitrios
>
> Steffen Zschaler wrote:
>> Hi,
>>
>> It seems I'm still doing something wrong here. Here's the code I put
>> into pre:
>>
>> pre {
>> var coreEPackage := Core!EPackage.all.first();
>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>
>> -- Copy Core Metamodel
>> var extEPackage := new target!EPackage;
>> extPackage.name := 'Bla';
>> extEPackage.eClassifiers.addAll(coreClassifiers);
>> extEPackage.eSubpackages.addAll(coreSubpackages);
>> }
>>
>> However, all I get is an empty resulting model.
>>
>> Any ideas where the error could be?
>>
>> Steffen
>>
>> Dimitrios Kolovos wrote:
>>> Oh! I made the assumption that your source model would be Core.
>>> Since it is not, putting the code either in pre or post should be fine.
>>>
>>> Cheers,
>>> Dimitrios
>>>
>>> Steffen Zschaler wrote:
>>>> Hi,
>>>>
>>>> Thanks again. Not sure, I completely understand this. Why would
>>>> there be nothing to transform? The rules I am writing are not
>>>> actually transforming elements from Core, but rather are creating
>>>> additional elements based on information from a 'source' model. Am
>>>> I right in assuming that in this case I would be OK to do the copy
>>>> in pre?
>>>>
>>>> Cheers,
>>>>
>>>> Steffen
>>>>
>>>> Dimitrios Kolovos wrote:
>>>>> I'd do this in the post section instead so that it runs after the
>>>>> ETL rules. Otherwise the rules will have nothing to transform in
>>>>> the source model. (Just make sure you don't store Core after the
>>>>> transformation is done because by putting the classifiers and
>>>>> subpackages to ext you are actually removing them from core).
>>>>>
>>>>> Cheers,
>>>>> Dimitrios
>>>>>
>>>>> Steffen Zschaler wrote:
>>>>>> Hi Dimitrios,
>>>>>>
>>>>>> Thanks for the quick reply. I am actually generating ext. Would I
>>>>>> be able, then, to do this in the preamble of my ETL file, e.g.:
>>>>>>
>>>>>> pre {
>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>
>>>>>> var extEPackage := new Ext!EPackage;
>>>>>> extPackage.name := 'Bla';
>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>> }
>>>>>> Cheers,
>>>>>>
>>>>>> Steffen
>>>>>>
>>>>>> Dimitrios Kolovos wrote:
>>>>>>> Hi Steffen,
>>>>>>>
>>>>>>> I think that the most efficient way in your case is to load the
>>>>>>> two metamodels in an EOL program, move the eClassifiers and
>>>>>>> eSubpackages of the core metamodel to the extension metamodel
>>>>>>> and then save the extension metamodel using a different name. E.g.
>>>>>>>
>>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>>> var extEPackage := Ext!EPackage.all.first();
>>>>>>>
>>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>>
>>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>>>
>>>>>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>>>>>
>>>>>>> (just make sure you un-tick the Save on disposal checkbox when
>>>>>>> specifying the models)
>>>>>>>
>>>>>>> I've attached an example project (+launch configuration) that
>>>>>>> does this on two minimal core and ext metamodels.
>>>>>>>
>>>>>>> Hope this helps,
>>>>>>> Dimitrios
>>>>>>>
>>>>>>> Steffen Zschaler wrote:
>>>>>>>> Hi again,
>>>>>>>>
>>>>>>>> I have a core ecore metamodel and want to generate an extension
>>>>>>>> metamodel for this. This essentially means that I need to add a
>>>>>>>> few subclasses for some abstract classes in the core metamodel.
>>>>>>>> As discussed in earlier mails, I have a few tools that have
>>>>>>>> problems with ecore metamodels referencing each other. Hence, I
>>>>>>>> cannot use linking between the metamodels. Instead, I am
>>>>>>>> planning to hack around this by including a copy of all classes
>>>>>>>> and relationships from the core metamodel in my generated
>>>>>>>> metamodel.
>>>>>>>>
>>>>>>>> What is the most efficient way of creating such a copy?
>>>>>>>>
>>>>>>>> Many thanks,
>>>>>>>>
>>>>>>>> Steffen
>>>>>>>>
>>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>>> Hi Steffen,
>>>>>>>>>
>>>>>>>>> There are more than one ways to do this in ETL, EOL. Could you
>>>>>>>>> please give me a bit more details as to what you are trying to
>>>>>>>>> do so that I can suggest the best solution?
>>>>>>>>>
>>>>>>>>> I'd be grateful if we could take the discussion over to the
>>>>>>>>> eclipse.epsilon newsgroup as it sounds as something
>>>>>>>>> potentially interesting to others too (and also the more
>>>>>>>>> activity in the newsgroup, the better for the project ;)
>>>>>>>>>
>>>>>>>>> Cheers,
>>>>>>>>> Dimitrios
>>>>>>>>>
>>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> Is there a possibility in ETL to create a copy of a source
>>>>>>>>>> model to be further expanded in the transformation?
>>>>>>>>>>
>>>>>>>>>> Many thanks,
>>>>>>>>>>
>>>>>>>>>> Steffen
>>>>>>
>>>>>> --
>>>>>> Dr. rer. nat. Steffen Zschaler
>>>>>> Senior Research Associate
>>>>>>
>>>>>> Lancaster University
>>>>>> Lancaster, United Kingdom
>>>>>>
>>>>>> Email szschaler@acm.org
>>>>>> WWW http://www.steffen-zschaler.de/
>>>>>>
>>>>>> --
>>>>>>
>>>>>> Consider submitting to QoSA 2009, the 5th International
>>>>>> Conference on
>>>>>> the Quality of Software-Architectures.
>>>>>> http://qosa.ipd.uka.de/
>>>>>>
>>>>>> Consider submitting to MiSE 2009, the 3rd International Workshop
>>>>>> on Models in Software Engineering
>>>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>>>
>>
>> --
>> Dr. rer. nat. Steffen Zschaler
>> Senior Research Associate
>>
>> Lancaster University
>> Lancaster, United Kingdom
>>
>> Email szschaler@acm.org
>> WWW http://www.steffen-zschaler.de/
>>
>> --
>>
>> Consider submitting to QoSA 2009, the 5th International Conference on
>> the Quality of Software-Architectures.
>> http://qosa.ipd.uka.de/
>>
>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>> Models in Software Engineering
>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>

--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
WWW http://www.steffen-zschaler.de/

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09
Re: Copying models in ETL [message #3644 is a reply to message #3611] Wed, 12 November 2008 13:45 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Steffen,

The parse methods (located in AbstractModule) return a boolean
indicating if parsing has succeeded/failed (in your case it should
return false). If you think raising an exception instead would be a
better approach could you please add a new bug/enhancement request? (you
can use the following direct link - also available in the Epsilon
homepage -
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=GMT& component=Epsilon)

Cheers,
Dimitrios

Steffen Zschaler wrote:
> :-( It seems I found another stupid mistake one can make in using
> Epsilon. I used module.parse ("path_to_ETL_file") and then went on from
> there. Debugging shows me that this seems to try and interpret
> "path_to_ETL_file" as the actual ETL code instead of the name of the
> file. Unfortunately, it didn't give me any error messages or exceptions
> but just silently ignored any problems involved and left me with an
> empty ETL module.
>
> Cheers,
>
> Steffen
>
> Dimitrios Kolovos wrote:
>> Hi Steffen,
>>
>> The only thing that comes to mind is that you don't store target when
>> the transformation ends. Could you please add a few print statements
>> after
>>
>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>
>> to see the state of your model once the statements above have executed?
>>
>> e.g.
>>
>> extEPackage.eClassifiers.println();
>>
>> If the problem persists, could you please send me your transformation
>> and involved models/metamodels so that I can investigate more?
>>
>> Cheers,
>> Dimitrios
>>
>> Steffen Zschaler wrote:
>>> Hi,
>>>
>>> It seems I'm still doing something wrong here. Here's the code I put
>>> into pre:
>>>
>>> pre {
>>> var coreEPackage := Core!EPackage.all.first();
>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>
>>> -- Copy Core Metamodel
>>> var extEPackage := new target!EPackage;
>>> extPackage.name := 'Bla';
>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>> }
>>> However, all I get is an empty resulting model.
>>>
>>> Any ideas where the error could be?
>>>
>>> Steffen
>>>
>>> Dimitrios Kolovos wrote:
>>>> Oh! I made the assumption that your source model would be Core.
>>>> Since it is not, putting the code either in pre or post should be fine.
>>>>
>>>> Cheers,
>>>> Dimitrios
>>>>
>>>> Steffen Zschaler wrote:
>>>>> Hi,
>>>>>
>>>>> Thanks again. Not sure, I completely understand this. Why would
>>>>> there be nothing to transform? The rules I am writing are not
>>>>> actually transforming elements from Core, but rather are creating
>>>>> additional elements based on information from a 'source' model. Am
>>>>> I right in assuming that in this case I would be OK to do the copy
>>>>> in pre?
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Steffen
>>>>>
>>>>> Dimitrios Kolovos wrote:
>>>>>> I'd do this in the post section instead so that it runs after the
>>>>>> ETL rules. Otherwise the rules will have nothing to transform in
>>>>>> the source model. (Just make sure you don't store Core after the
>>>>>> transformation is done because by putting the classifiers and
>>>>>> subpackages to ext you are actually removing them from core).
>>>>>>
>>>>>> Cheers,
>>>>>> Dimitrios
>>>>>>
>>>>>> Steffen Zschaler wrote:
>>>>>>> Hi Dimitrios,
>>>>>>>
>>>>>>> Thanks for the quick reply. I am actually generating ext. Would I
>>>>>>> be able, then, to do this in the preamble of my ETL file, e.g.:
>>>>>>>
>>>>>>> pre {
>>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>>
>>>>>>> var extEPackage := new Ext!EPackage;
>>>>>>> extPackage.name := 'Bla';
>>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>>> }
>>>>>>> Cheers,
>>>>>>>
>>>>>>> Steffen
>>>>>>>
>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>> Hi Steffen,
>>>>>>>>
>>>>>>>> I think that the most efficient way in your case is to load the
>>>>>>>> two metamodels in an EOL program, move the eClassifiers and
>>>>>>>> eSubpackages of the core metamodel to the extension metamodel
>>>>>>>> and then save the extension metamodel using a different name. E.g.
>>>>>>>>
>>>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>>>> var extEPackage := Ext!EPackage.all.first();
>>>>>>>>
>>>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>>>
>>>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>>>>
>>>>>>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>>>>>>
>>>>>>>> (just make sure you un-tick the Save on disposal checkbox when
>>>>>>>> specifying the models)
>>>>>>>>
>>>>>>>> I've attached an example project (+launch configuration) that
>>>>>>>> does this on two minimal core and ext metamodels.
>>>>>>>>
>>>>>>>> Hope this helps,
>>>>>>>> Dimitrios
>>>>>>>>
>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>> Hi again,
>>>>>>>>>
>>>>>>>>> I have a core ecore metamodel and want to generate an extension
>>>>>>>>> metamodel for this. This essentially means that I need to add a
>>>>>>>>> few subclasses for some abstract classes in the core metamodel.
>>>>>>>>> As discussed in earlier mails, I have a few tools that have
>>>>>>>>> problems with ecore metamodels referencing each other. Hence, I
>>>>>>>>> cannot use linking between the metamodels. Instead, I am
>>>>>>>>> planning to hack around this by including a copy of all classes
>>>>>>>>> and relationships from the core metamodel in my generated
>>>>>>>>> metamodel.
>>>>>>>>>
>>>>>>>>> What is the most efficient way of creating such a copy?
>>>>>>>>>
>>>>>>>>> Many thanks,
>>>>>>>>>
>>>>>>>>> Steffen
>>>>>>>>>
>>>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>>>> Hi Steffen,
>>>>>>>>>>
>>>>>>>>>> There are more than one ways to do this in ETL, EOL. Could you
>>>>>>>>>> please give me a bit more details as to what you are trying to
>>>>>>>>>> do so that I can suggest the best solution?
>>>>>>>>>>
>>>>>>>>>> I'd be grateful if we could take the discussion over to the
>>>>>>>>>> eclipse.epsilon newsgroup as it sounds as something
>>>>>>>>>> potentially interesting to others too (and also the more
>>>>>>>>>> activity in the newsgroup, the better for the project ;)
>>>>>>>>>>
>>>>>>>>>> Cheers,
>>>>>>>>>> Dimitrios
>>>>>>>>>>
>>>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> Is there a possibility in ETL to create a copy of a source
>>>>>>>>>>> model to be further expanded in the transformation?
>>>>>>>>>>>
>>>>>>>>>>> Many thanks,
>>>>>>>>>>>
>>>>>>>>>>> Steffen
>>>>>>>
>>>>>>> --
>>>>>>> Dr. rer. nat. Steffen Zschaler
>>>>>>> Senior Research Associate
>>>>>>>
>>>>>>> Lancaster University
>>>>>>> Lancaster, United Kingdom
>>>>>>>
>>>>>>> Email szschaler@acm.org
>>>>>>> WWW http://www.steffen-zschaler.de/
>>>>>>>
>>>>>>> --
>>>>>>>
>>>>>>> Consider submitting to QoSA 2009, the 5th International
>>>>>>> Conference on
>>>>>>> the Quality of Software-Architectures.
>>>>>>> http://qosa.ipd.uka.de/
>>>>>>>
>>>>>>> Consider submitting to MiSE 2009, the 3rd International Workshop
>>>>>>> on Models in Software Engineering
>>>>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>>>>
>>>
>>> --
>>> Dr. rer. nat. Steffen Zschaler
>>> Senior Research Associate
>>>
>>> Lancaster University
>>> Lancaster, United Kingdom
>>>
>>> Email szschaler@acm.org
>>> WWW http://www.steffen-zschaler.de/
>>>
>>> --
>>>
>>> Consider submitting to QoSA 2009, the 5th International Conference on
>>> the Quality of Software-Architectures.
>>> http://qosa.ipd.uka.de/
>>>
>>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>>> Models in Software Engineering
>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>>
>
Re: Copying models in ETL [message #3712 is a reply to message #3644] Wed, 12 November 2008 14:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: szchaler.acm.org

This is a multi-part message in MIME format.
--------------020902040106010302050708
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

I think there should be an exception instead. However, I'm not sure that
this is at the heart of things here. In particular, I was using the
following code to do the parsing:

module.parse ("path_to_ETL_file");
if (module.getParseProblems().size() > 0) {
System.err.println("Parse errors occured...");
for (ParseProblem problem : module.getParseProblems()) {
System.err.println(problem.toString());
}
throw new RuntimeException("Parse Problems.");
}


and no parse problems where indicated...

Steffen

Dimitrios Kolovos wrote:
> Hi Steffen,
>
> The parse methods (located in AbstractModule) return a boolean
> indicating if parsing has succeeded/failed (in your case it should
> return false). If you think raising an exception instead would be a
> better approach could you please add a new bug/enhancement request?
> (you can use the following direct link - also available in the Epsilon
> homepage -
> https://bugs.eclipse.org/bugs/enter_bug.cgi?product=GMT& component=Epsilon)
>
>
> Cheers,
> Dimitrios
>
> Steffen Zschaler wrote:
>> :-( It seems I found another stupid mistake one can make in using
>> Epsilon. I used module.parse ("path_to_ETL_file") and then went on
>> from there. Debugging shows me that this seems to try and interpret
>> "path_to_ETL_file" as the actual ETL code instead of the name of the
>> file. Unfortunately, it didn't give me any error messages or
>> exceptions but just silently ignored any problems involved and left
>> me with an empty ETL module.
>>
>> Cheers,
>>
>> Steffen
>>
>> Dimitrios Kolovos wrote:
>>> Hi Steffen,
>>>
>>> The only thing that comes to mind is that you don't store target
>>> when the transformation ends. Could you please add a few print
>>> statements after
>>>
>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>
>>> to see the state of your model once the statements above have executed?
>>>
>>> e.g.
>>>
>>> extEPackage.eClassifiers.println();
>>>
>>> If the problem persists, could you please send me your
>>> transformation and involved models/metamodels so that I can
>>> investigate more?
>>>
>>> Cheers,
>>> Dimitrios
>>>
>>> Steffen Zschaler wrote:
>>>> Hi,
>>>>
>>>> It seems I'm still doing something wrong here. Here's the code I
>>>> put into pre:
>>>>
>>>> pre {
>>>> var coreEPackage := Core!EPackage.all.first();
>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>
>>>> -- Copy Core Metamodel
>>>> var extEPackage := new target!EPackage;
>>>> extPackage.name := 'Bla';
>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>> }
>>>> However, all I get is an empty resulting model.
>>>>
>>>> Any ideas where the error could be?
>>>>
>>>> Steffen
>>>>
>>>> Dimitrios Kolovos wrote:
>>>>> Oh! I made the assumption that your source model would be Core.
>>>>> Since it is not, putting the code either in pre or post should be
>>>>> fine.
>>>>>
>>>>> Cheers,
>>>>> Dimitrios
>>>>>
>>>>> Steffen Zschaler wrote:
>>>>>> Hi,
>>>>>>
>>>>>> Thanks again. Not sure, I completely understand this. Why would
>>>>>> there be nothing to transform? The rules I am writing are not
>>>>>> actually transforming elements from Core, but rather are creating
>>>>>> additional elements based on information from a 'source' model.
>>>>>> Am I right in assuming that in this case I would be OK to do the
>>>>>> copy in pre?
>>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>> Steffen
>>>>>>
>>>>>> Dimitrios Kolovos wrote:
>>>>>>> I'd do this in the post section instead so that it runs after
>>>>>>> the ETL rules. Otherwise the rules will have nothing to
>>>>>>> transform in the source model. (Just make sure you don't store
>>>>>>> Core after the transformation is done because by putting the
>>>>>>> classifiers and subpackages to ext you are actually removing
>>>>>>> them from core).
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Dimitrios
>>>>>>>
>>>>>>> Steffen Zschaler wrote:
>>>>>>>> Hi Dimitrios,
>>>>>>>>
>>>>>>>> Thanks for the quick reply. I am actually generating ext. Would
>>>>>>>> I be able, then, to do this in the preamble of my ETL file, e.g.:
>>>>>>>>
>>>>>>>> pre {
>>>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>>>
>>>>>>>> var extEPackage := new Ext!EPackage;
>>>>>>>> extPackage.name := 'Bla';
>>>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>>>> }
>>>>>>>> Cheers,
>>>>>>>>
>>>>>>>> Steffen
>>>>>>>>
>>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>>> Hi Steffen,
>>>>>>>>>
>>>>>>>>> I think that the most efficient way in your case is to load
>>>>>>>>> the two metamodels in an EOL program, move the eClassifiers
>>>>>>>>> and eSubpackages of the core metamodel to the extension
>>>>>>>>> metamodel and then save the extension metamodel using a
>>>>>>>>> different name. E.g.
>>>>>>>>>
>>>>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>>>>> var extEPackage := Ext!EPackage.all.first();
>>>>>>>>>
>>>>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>>>>
>>>>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>>>>>
>>>>>>>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>>>>>>>
>>>>>>>>> (just make sure you un-tick the Save on disposal checkbox when
>>>>>>>>> specifying the models)
>>>>>>>>>
>>>>>>>>> I've attached an example project (+launch configuration) that
>>>>>>>>> does this on two minimal core and ext metamodels.
>>>>>>>>>
>>>>>>>>> Hope this helps,
>>>>>>>>> Dimitrios
>>>>>>>>>
>>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>>> Hi again,
>>>>>>>>>>
>>>>>>>>>> I have a core ecore metamodel and want to generate an
>>>>>>>>>> extension metamodel for this. This essentially means that I
>>>>>>>>>> need to add a few subclasses for some abstract classes in the
>>>>>>>>>> core metamodel. As discussed in earlier mails, I have a few
>>>>>>>>>> tools that have problems with ecore metamodels referencing
>>>>>>>>>> each other. Hence, I cannot use linking between the
>>>>>>>>>> metamodels. Instead, I am planning to hack around this by
>>>>>>>>>> including a copy of all classes and relationships from the
>>>>>>>>>> core metamodel in my generated metamodel.
>>>>>>>>>>
>>>>>>>>>> What is the most efficient way of creating such a copy?
>>>>>>>>>>
>>>>>>>>>> Many thanks,
>>>>>>>>>>
>>>>>>>>>> Steffen
>>>>>>>>>>
>>>>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>>>>> Hi Steffen,
>>>>>>>>>>>
>>>>>>>>>>> There are more than one ways to do this in ETL, EOL. Could
>>>>>>>>>>> you please give me a bit more details as to what you are
>>>>>>>>>>> trying to do so that I can suggest the best solution?
>>>>>>>>>>>
>>>>>>>>>>> I'd be grateful if we could take the discussion over to the
>>>>>>>>>>> eclipse.epsilon newsgroup as it sounds as something
>>>>>>>>>>> potentially interesting to others too (and also the more
>>>>>>>>>>> activity in the newsgroup, the better for the project ;)
>>>>>>>>>>>
>>>>>>>>>>> Cheers,
>>>>>>>>>>> Dimitrios
>>>>>>>>>>>
>>>>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>>>>> Hi,
>>>>>>>>>>>>
>>>>>>>>>>>> Is there a possibility in ETL to create a copy of a source
>>>>>>>>>>>> model to be further expanded in the transformation?
>>>>>>>>>>>>
>>>>>>>>>>>> Many thanks,
>>>>>>>>>>>>
>>>>>>>>>>>> Steffen
>>>>>>>>
>>>>>>>> --
>>>>>>>> Dr. rer. nat. Steffen Zschaler
>>>>>>>> Senior Research Associate
>>>>>>>>
>>>>>>>> Lancaster University
>>>>>>>> Lancaster, United Kingdom
>>>>>>>>
>>>>>>>> Email szschaler@acm.org
>>>>>>>> WWW http://www.steffen-zschaler.de/
>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>>> Consider submitting to QoSA 2009, the 5th International
>>>>>>>> Conference on
>>>>>>>> the Quality of Software-Architectures.
>>>>>>>> http://qosa.ipd.uka.de/
>>>>>>>>
>>>>>>>> Consider submitting to MiSE 2009, the 3rd International
>>>>>>>> Workshop on Models in Software Engineering
>>>>>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>>>>>
>>>>
>>>> --
>>>> Dr. rer. nat. Steffen Zschaler
>>>> Senior Research Associate
>>>>
>>>> Lancaster University
>>>> Lancaster, United Kingdom
>>>>
>>>> Email szschaler@acm.org
>>>> WWW http://www.steffen-zschaler.de/
>>>>
>>>> --
>>>>
>>>> Consider submitting to QoSA 2009, the 5th International Conference on
>>>> the Quality of Software-Architectures.
>>>> http://qosa.ipd.uka.de/
>>>>
>>>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>>>> Models in Software Engineering
>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>>>
>>

--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
WWW http://www.steffen-zschaler.de/

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09


--------------020902040106010302050708
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
I think there should be an exception instead. However, I'm not sure
that this is at the heart of things here. In particular, I was using
the following code to do the parsing:<br>
<blockquote>
<pre>module.parse ("path_to_ETL_file");
if (module.getParseProblems().size() &gt; 0) {
System.err.println("Parse errors occured...");
for (ParseProblem problem : module.getParseProblems()) {
System.err.println(problem.toString());
}
throw new RuntimeException("Parse Problems.");
}
</pre>
</blockquote>
and no parse problems where indicated...<br>
<br>
Steffen<br>
<br>
Dimitrios Kolovos wrote:
<blockquote cite="mid:gfemlr$kt2$4@build.eclipse.org" type="cite">Hi
Steffen,
<br>
<br>
The parse methods (located in AbstractModule) return a boolean
indicating if parsing has succeeded/failed (in your case it should
return false). If you think raising an exception instead would be a
better approach could you please add a new bug/enhancement request?
(you can use the following direct link - also available in the Epsilon
homepage -
<a class="moz-txt-link-freetext" href=" https://bugs.eclipse.org/bugs/enter_bug.cgi?product=GMT& component=Epsilon"> https://bugs.eclipse.org/bugs/enter_bug.cgi?product=GMT& amp;component=Epsilon</a>)
<br>
<br>
Cheers,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">:-( It seems I found another stupid mistake
one can make in using Epsilon. I used module.parse ("path_to_ETL_file")
and then went on from there. Debugging shows me that this seems to try
and interpret "path_to_ETL_file" as the actual ETL code instead of the
name of the file. Unfortunately, it didn't give me any error messages
or exceptions but just silently ignored any problems involved and left
me with an empty ETL module.
<br>
<br>
Cheers,
<br>
<br>
Steffen
<br>
<br>
Dimitrios Kolovos wrote:
<br>
<blockquote type="cite">Hi Steffen,
<br>
<br>
The only thing that comes to mind is that you don't store target when
the transformation ends. Could you please add a few print statements
after
<br>
<br>
extEPackage.eSubpackages.addAll(coreSubpackages);
<br>
<br>
to see the state of your model once the statements above have executed?
<br>
<br>
e.g.
<br>
<br>
extEPackage.eClassifiers.println();
<br>
<br>
If the problem persists, could you please send me your transformation
and involved models/metamodels so that I can investigate more?
<br>
<br>
Cheers,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
It seems I'm still doing something wrong here. Here's the code I put
into pre:
<br>
<br>
&nbsp;&nbsp;&nbsp; pre {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var coreEPackage := Core!EPackage.all.first();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var coreClassifiers := coreEPackage.eClassifiers.clone();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var coreSubpackages := coreEPackage.eSubpackages.clone();
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Copy Core Metamodel
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var extEPackage := new target!EPackage;
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extPackage.name := 'Bla';
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extEPackage.eClassifiers.addAll(coreClassifiers);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extEPackage.eSubpackages.addAll(coreSubpackages);
<br>
&nbsp;&nbsp;&nbsp; }
<br>
&nbsp;&nbsp;&nbsp;&nbsp; However, all I get is an empty resulting model.
<br>
<br>
Any ideas where the error could be?
<br>
<br>
Steffen
<br>
<br>
Dimitrios Kolovos wrote:
<br>
<blockquote type="cite">Oh! I made the assumption that your
source model would be Core. Since it is not, putting the code either in
pre or post should be fine.
<br>
<br>
Cheers,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
Thanks again. Not sure, I completely understand this. Why would there
be nothing to transform? The rules I am writing are not actually
transforming elements from Core, but rather are creating additional
elements based on information from a 'source' model. Am I right in
assuming that in this case I would be OK to do the copy in pre?
<br>
<br>
Cheers,
<br>
<br>
Steffen
<br>
<br>
Dimitrios Kolovos wrote:
<br>
<blockquote type="cite">I'd do this in the post section
instead so that it runs after the ETL rules. Otherwise the rules will
have nothing to transform in the source model. (Just make sure you
don't store Core after the transformation is done because by putting
the classifiers and subpackages to ext you are actually removing them
from core).
<br>
<br>
Cheers,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi Dimitrios,
<br>
<br>
Thanks for the quick reply. I am actually generating ext. Would I be
able, then, to do this in the preamble of my ETL file, e.g.:
<br>
<br>
&nbsp;&nbsp;&nbsp; pre {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var coreEPackage := Core!EPackage.all.first();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var coreClassifiers := coreEPackage.eClassifiers.clone();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var coreSubpackages := coreEPackage.eSubpackages.clone();
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var extEPackage := new Ext!EPackage;
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extPackage.name := 'Bla';
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extEPackage.eClassifiers.addAll(coreClassifiers);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extEPackage.eSubpackages.addAll(coreSubpackages);
<br>
&nbsp;&nbsp;&nbsp; }
<br>
&nbsp;&nbsp;&nbsp;&nbsp; Cheers,
<br>
<br>
Steffen
<br>
<br>
Dimitrios Kolovos wrote:
<br>
<blockquote type="cite">Hi Steffen,
<br>
<br>
I think that the most efficient way in your case is to load the two
metamodels in an EOL program, move the eClassifiers and eSubpackages of
the core metamodel to the extension metamodel and then save the
extension metamodel using a different name. E.g.
<br>
<br>
var coreEPackage := Core!EPackage.all.first();
<br>
var extEPackage := Ext!EPackage.all.first();
<br>
<br>
var coreClassifiers := coreEPackage.eClassifiers.clone();
<br>
var coreSubpackages := coreEPackage.eSubpackages.clone();
<br>
<br>
extEPackage.eClassifiers.addAll(coreClassifiers);
<br>
extEPackage.eSubpackages.addAll(coreSubpackages);
<br>
<br>
Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
<br>
<br>
(just make sure you un-tick the Save on disposal checkbox when
specifying the models)
<br>
<br>
I've attached an example project (+launch configuration) that does this
on two minimal core and ext metamodels.
<br>
<br>
Hope this helps,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi again,
<br>
<br>
I have a core ecore metamodel and want to generate an extension
metamodel for this. This essentially means that I need to add a few
subclasses for some abstract classes in the core metamodel. As
discussed in earlier mails, I have a few tools that have problems with
ecore metamodels referencing each other. Hence, I cannot use linking
between the metamodels. Instead, I am planning to hack around this by
including a copy of all classes and relationships from the core
metamodel in my generated metamodel.
<br>
<br>
What is the most efficient way of creating such a copy?
<br>
<br>
Many thanks,
<br>
<br>
Steffen
<br>
<br>
Dimitrios Kolovos wrote:
<br>
<blockquote type="cite">Hi Steffen,
<br>
<br>
There are more than one ways to do this in ETL, EOL. Could you please
give me a bit more details as to what you are trying to do so that I
can suggest the best solution?
<br>
<br>
I'd be grateful if we could take the discussion over to the
eclipse.epsilon newsgroup as it sounds as something potentially
interesting to others too (and also the more activity in the newsgroup,
the better for the project ;)
<br>
<br>
Cheers,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
Is there a possibility in ETL to create a copy of a source model to be
further expanded in the transformation?
<br>
<br>
Many thanks,
<br>
<br>
Steffen
<br>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<br>
--&nbsp;<br>
Dr. rer. nat. Steffen Zschaler
<br>
Senior Research Associate
<br>
<br>
Lancaster University
<br>
Lancaster, United Kingdom
<br>
<br>
Email <a class="moz-txt-link-abbreviated" href="mailto:szschaler@acm.org">szschaler@acm.org</a>
<br>
WWW&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="http://www.steffen-zschaler.de/">http://www..steffen-zschaler.de/</a>
<br>
<br>
--&nbsp;<br>
<br>
Consider submitting to QoSA 2009, the 5th International Conference on
<br>
the Quality of Software-Architectures.
<br>
<a class="moz-txt-link-freetext" href="http://qosa.ipd.uka.de/">http://qosa.ipd.uka.de/</a>
<br>
<br>
Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
<br>
<a class="moz-txt-link-freetext" href="http://wikiserver.sse.cs.tu-bs.de/mise09">http://wikiserver.sse.cs.tu-bs.de/mise09</a>
<br>
</blockquote>
</blockquote>
<br>
</blockquote>
</blockquote>
<br>
--&nbsp;<br>
Dr. rer. nat. Steffen Zschaler
<br>
Senior Research Associate
<br>
<br>
Lancaster University
<br>
Lancaster, United Kingdom
<br>
<br>
Email <a class="moz-txt-link-abbreviated" href="mailto:szschaler@acm.org">szschaler@acm.org</a>
<br>
WWW&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="http://www.steffen-zschaler.de/">http://www.steffen-zschaler.de/</a>
<br>
<br>
--&nbsp;<br>
<br>
Consider submitting to QoSA 2009, the 5th International Conference on
<br>
the Quality of Software-Architectures.
<br>
<a class="moz-txt-link-freetext" href="http://qosa.ipd.uka.de/">http://qosa.ipd.uka.de/</a>
<br>
<br>
Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
<br>
<a class="moz-txt-link-freetext" href="http://wikiserver.sse.cs.tu-bs.de/mise09">http://wikiserver.sse.cs.tu-bs.de/mise09</a>
<br>
<br>
</blockquote>
</blockquote>
<br>
</blockquote>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email <a class="moz-txt-link-abbreviated" href="mailto:szschaler@acm.org">szschaler@acm.org</a>
WWW <a class="moz-txt-link-freetext" href="http://www.steffen-zschaler.de/">http://www.steffen-zschaler.de/</a>

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
<a class="moz-txt-link-freetext" href="http://qosa.ipd.uka.de/">http://qosa.ipd.uka.de/</a>

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
<a class="moz-txt-link-freetext" href="http://wikiserver.sse.cs.tu-bs.de/mise09">http://wikiserver.sse.cs.tu-bs.de/mise09</a></pre>
</body>
</html>

--------------020902040106010302050708--
Re: Copying models in ETL [message #4089 is a reply to message #3712] Wed, 12 November 2008 14:37 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Steffen,

With the current version you'd have to do something like:

boolean parseOK = module.parse(...);
if (!parseOK || module.getProblems().size() > 0) {
...
}

Thanks for submitting https://bugs.eclipse.org/bugs/show_bug.cgi?id=255046

Cheers,
Dimitrios

Steffen Zschaler wrote:
> Hi,
>
> I think there should be an exception instead. However, I'm not sure that
> this is at the heart of things here. In particular, I was using the
> following code to do the parsing:
>
> module.parse ("path_to_ETL_file");
> if (module.getParseProblems().size() > 0) {
> System.err.println("Parse errors occured...");
> for (ParseProblem problem : module.getParseProblems()) {
> System.err.println(problem.toString());
> }
> throw new RuntimeException("Parse Problems.");
> }
>
>
> and no parse problems where indicated...
>
> Steffen
>
> Dimitrios Kolovos wrote:
>> Hi Steffen,
>>
>> The parse methods (located in AbstractModule) return a boolean
>> indicating if parsing has succeeded/failed (in your case it should
>> return false). If you think raising an exception instead would be a
>> better approach could you please add a new bug/enhancement request?
>> (you can use the following direct link - also available in the Epsilon
>> homepage -
>> https://bugs.eclipse.org/bugs/enter_bug.cgi?product=GMT& component=Epsilon)
>>
>>
>> Cheers,
>> Dimitrios
>>
>> Steffen Zschaler wrote:
>>> :-( It seems I found another stupid mistake one can make in using
>>> Epsilon. I used module.parse ("path_to_ETL_file") and then went on
>>> from there. Debugging shows me that this seems to try and interpret
>>> "path_to_ETL_file" as the actual ETL code instead of the name of the
>>> file. Unfortunately, it didn't give me any error messages or
>>> exceptions but just silently ignored any problems involved and left
>>> me with an empty ETL module.
>>>
>>> Cheers,
>>>
>>> Steffen
>>>
>>> Dimitrios Kolovos wrote:
>>>> Hi Steffen,
>>>>
>>>> The only thing that comes to mind is that you don't store target
>>>> when the transformation ends. Could you please add a few print
>>>> statements after
>>>>
>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>
>>>> to see the state of your model once the statements above have executed?
>>>>
>>>> e.g.
>>>>
>>>> extEPackage.eClassifiers.println();
>>>>
>>>> If the problem persists, could you please send me your
>>>> transformation and involved models/metamodels so that I can
>>>> investigate more?
>>>>
>>>> Cheers,
>>>> Dimitrios
>>>>
>>>> Steffen Zschaler wrote:
>>>>> Hi,
>>>>>
>>>>> It seems I'm still doing something wrong here. Here's the code I
>>>>> put into pre:
>>>>>
>>>>> pre {
>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>
>>>>> -- Copy Core Metamodel
>>>>> var extEPackage := new target!EPackage;
>>>>> extPackage.name := 'Bla';
>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>> }
>>>>> However, all I get is an empty resulting model.
>>>>>
>>>>> Any ideas where the error could be?
>>>>>
>>>>> Steffen
>>>>>
>>>>> Dimitrios Kolovos wrote:
>>>>>> Oh! I made the assumption that your source model would be Core.
>>>>>> Since it is not, putting the code either in pre or post should be
>>>>>> fine.
>>>>>>
>>>>>> Cheers,
>>>>>> Dimitrios
>>>>>>
>>>>>> Steffen Zschaler wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> Thanks again. Not sure, I completely understand this. Why would
>>>>>>> there be nothing to transform? The rules I am writing are not
>>>>>>> actually transforming elements from Core, but rather are creating
>>>>>>> additional elements based on information from a 'source' model.
>>>>>>> Am I right in assuming that in this case I would be OK to do the
>>>>>>> copy in pre?
>>>>>>>
>>>>>>> Cheers,
>>>>>>>
>>>>>>> Steffen
>>>>>>>
>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>> I'd do this in the post section instead so that it runs after
>>>>>>>> the ETL rules. Otherwise the rules will have nothing to
>>>>>>>> transform in the source model. (Just make sure you don't store
>>>>>>>> Core after the transformation is done because by putting the
>>>>>>>> classifiers and subpackages to ext you are actually removing
>>>>>>>> them from core).
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>> Dimitrios
>>>>>>>>
>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>> Hi Dimitrios,
>>>>>>>>>
>>>>>>>>> Thanks for the quick reply. I am actually generating ext. Would
>>>>>>>>> I be able, then, to do this in the preamble of my ETL file, e.g.:
>>>>>>>>>
>>>>>>>>> pre {
>>>>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>>>>
>>>>>>>>> var extEPackage := new Ext!EPackage;
>>>>>>>>> extPackage.name := 'Bla';
>>>>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>>>>> }
>>>>>>>>> Cheers,
>>>>>>>>>
>>>>>>>>> Steffen
>>>>>>>>>
>>>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>>>> Hi Steffen,
>>>>>>>>>>
>>>>>>>>>> I think that the most efficient way in your case is to load
>>>>>>>>>> the two metamodels in an EOL program, move the eClassifiers
>>>>>>>>>> and eSubpackages of the core metamodel to the extension
>>>>>>>>>> metamodel and then save the extension metamodel using a
>>>>>>>>>> different name. E.g.
>>>>>>>>>>
>>>>>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>>>>>> var extEPackage := Ext!EPackage.all.first();
>>>>>>>>>>
>>>>>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>>>>>
>>>>>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>>>>>>
>>>>>>>>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>>>>>>>>
>>>>>>>>>> (just make sure you un-tick the Save on disposal checkbox when
>>>>>>>>>> specifying the models)
>>>>>>>>>>
>>>>>>>>>> I've attached an example project (+launch configuration) that
>>>>>>>>>> does this on two minimal core and ext metamodels.
>>>>>>>>>>
>>>>>>>>>> Hope this helps,
>>>>>>>>>> Dimitrios
>>>>>>>>>>
>>>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>>>> Hi again,
>>>>>>>>>>>
>>>>>>>>>>> I have a core ecore metamodel and want to generate an
>>>>>>>>>>> extension metamodel for this. This essentially means that I
>>>>>>>>>>> need to add a few subclasses for some abstract classes in the
>>>>>>>>>>> core metamodel. As discussed in earlier mails, I have a few
>>>>>>>>>>> tools that have problems with ecore metamodels referencing
>>>>>>>>>>> each other. Hence, I cannot use linking between the
>>>>>>>>>>> metamodels. Instead, I am planning to hack around this by
>>>>>>>>>>> including a copy of all classes and relationships from the
>>>>>>>>>>> core metamodel in my generated metamodel.
>>>>>>>>>>>
>>>>>>>>>>> What is the most efficient way of creating such a copy?
>>>>>>>>>>>
>>>>>>>>>>> Many thanks,
>>>>>>>>>>>
>>>>>>>>>>> Steffen
>>>>>>>>>>>
>>>>>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>>>>>> Hi Steffen,
>>>>>>>>>>>>
>>>>>>>>>>>> There are more than one ways to do this in ETL, EOL. Could
>>>>>>>>>>>> you please give me a bit more details as to what you are
>>>>>>>>>>>> trying to do so that I can suggest the best solution?
>>>>>>>>>>>>
>>>>>>>>>>>> I'd be grateful if we could take the discussion over to the
>>>>>>>>>>>> eclipse.epsilon newsgroup as it sounds as something
>>>>>>>>>>>> potentially interesting to others too (and also the more
>>>>>>>>>>>> activity in the newsgroup, the better for the project ;)
>>>>>>>>>>>>
>>>>>>>>>>>> Cheers,
>>>>>>>>>>>> Dimitrios
>>>>>>>>>>>>
>>>>>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>
>>>>>>>>>>>>> Is there a possibility in ETL to create a copy of a source
>>>>>>>>>>>>> model to be further expanded in the transformation?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Many thanks,
>>>>>>>>>>>>>
>>>>>>>>>>>>> Steffen
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Dr. rer. nat. Steffen Zschaler
>>>>>>>>> Senior Research Associate
>>>>>>>>>
>>>>>>>>> Lancaster University
>>>>>>>>> Lancaster, United Kingdom
>>>>>>>>>
>>>>>>>>> Email szschaler@acm.org
>>>>>>>>> WWW http://www..steffen-zschaler.de/
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>>
>>>>>>>>> Consider submitting to QoSA 2009, the 5th International
>>>>>>>>> Conference on
>>>>>>>>> the Quality of Software-Architectures.
>>>>>>>>> http://qosa.ipd.uka.de/
>>>>>>>>>
>>>>>>>>> Consider submitting to MiSE 2009, the 3rd International
>>>>>>>>> Workshop on Models in Software Engineering
>>>>>>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>>>>>>
>>>>>
>>>>> --
>>>>> Dr. rer. nat. Steffen Zschaler
>>>>> Senior Research Associate
>>>>>
>>>>> Lancaster University
>>>>> Lancaster, United Kingdom
>>>>>
>>>>> Email szschaler@acm.org
>>>>> WWW http://www.steffen-zschaler.de/
>>>>>
>>>>> --
>>>>>
>>>>> Consider submitting to QoSA 2009, the 5th International Conference on
>>>>> the Quality of Software-Architectures.
>>>>> http://qosa.ipd.uka.de/
>>>>>
>>>>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>>>>> Models in Software Engineering
>>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>>>>
>>>
>
> --
> Dr. rer. nat. Steffen Zschaler
> Senior Research Associate
>
> Lancaster University
> Lancaster, United Kingdom
>
> Email szschaler@acm.org
> WWW http://www.steffen-zschaler.de/
>
> --
>
> Consider submitting to QoSA 2009, the 5th International Conference on
> the Quality of Software-Architectures.
> http://qosa.ipd.uka.de/
>
> Consider submitting to MiSE 2009, the 3rd International Workshop on
> Models in Software Engineering
> http://wikiserver.sse.cs.tu-bs.de/mise09
>
Re: Copying models in ETL [message #561482 is a reply to message #1977] Tue, 11 November 2008 15:53 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000209080005090406070101
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Steffen,

I think that the most efficient way in your case is to load the two
metamodels in an EOL program, move the eClassifiers and eSubpackages of
the core metamodel to the extension metamodel and then save the
extension metamodel using a different name. E.g.

var coreEPackage := Core!EPackage.all.first();
var extEPackage := Ext!EPackage.all.first();

var coreClassifiers := coreEPackage.eClassifiers.clone();
var coreSubpackages := coreEPackage.eSubpackages.clone();

extEPackage.eClassifiers.addAll(coreClassifiers);
extEPackage.eSubpackages.addAll(coreSubpackages);

Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));

(just make sure you un-tick the Save on disposal checkbox when
specifying the models)

I've attached an example project (+launch configuration) that does this
on two minimal core and ext metamodels.

Hope this helps,
Dimitrios

Steffen Zschaler wrote:
> Hi again,
>
> I have a core ecore metamodel and want to generate an extension
> metamodel for this. This essentially means that I need to add a few
> subclasses for some abstract classes in the core metamodel. As discussed
> in earlier mails, I have a few tools that have problems with ecore
> metamodels referencing each other. Hence, I cannot use linking between
> the metamodels. Instead, I am planning to hack around this by including
> a copy of all classes and relationships from the core metamodel in my
> generated metamodel.
>
> What is the most efficient way of creating such a copy?
>
> Many thanks,
>
> Steffen
>
> Dimitrios Kolovos wrote:
>> Hi Steffen,
>>
>> There are more than one ways to do this in ETL, EOL. Could you please
>> give me a bit more details as to what you are trying to do so that I
>> can suggest the best solution?
>>
>> I'd be grateful if we could take the discussion over to the
>> eclipse.epsilon newsgroup as it sounds as something potentially
>> interesting to others too (and also the more activity in the
>> newsgroup, the better for the project ;)
>>
>> Cheers,
>> Dimitrios
>>
>> Steffen Zschaler wrote:
>>> Hi,
>>>
>>> Is there a possibility in ETL to create a copy of a source model to
>>> be further expanded in the transformation?
>>>
>>> Many thanks,
>>>
>>> Steffen


--------------000209080005090406070101
Content-Type: application/x-zip-compressed;
name="MergeMetamodels.zip"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="MergeMetamodels.zip"

UEsDBBQAAAAIACCFazkZDX08iAAAANsAAAAIAAAALnByb2plY3RVjkEOwiAQ RdeaeIeGvaI7
F5RujLuu1AMg/DSYMhCgxuPb1qphN+/9mZ8Rzcv11RMxWU81O+z2rAJpbyx1 Nbtdz9sja+Rm
LUL0D+h8QtLRhjxuj3YlSDnIFrFDi6ycN+iT4LOdYu2dA2Up+Hea7NKVZuAF 3Qfbm0uA/mQl
kspDxHL2h19F+dwbUEsDBBQAAAAIADaFazkVMWuC1QAAAFQBAAAKAAAAY29y ZS5lY29yZVWQ
ywrCMBBF94L/EGZvU+tGQqsLURAUxAe4DXFag01SmmLr3zuND2hWk7n3HmYm XXamZE+svXY2
g2kUA0Or3E3bIoPLeTOZw3IxHqWoXI1ifZDqIQtkndHin0ooNR4xegSzXpCY wb1pKsF527aR
M0Xk6oJf91v4WfzQ0s6CI4njKdl2J3VHIyfa+kZahQN6mGQQRlXqymMgoMl7 SsLXvQ2YlYbM
of5ArL8ct98OfQ415rrLABa9nOKqlN7rXNNujIYUzaui/Hf7IP6YK+D9Yfjw MtR6A1BLAwQU
AAAACAA1hWs5cbq1p0MAAABFAAAACAAAAGNvcmUuZW1mc8hLzE0tLkhMTtUo Lcq0VUrOL0pV
0lEoKEpNy6ywVVLS5OUCSmYnpqcqgKSsebl4uZJzEouLFZwVqnm5FBQUeLlq AVBLAwQUAAAA
CADUhWs5+4UWlecAAABpAQAACQAAAGV4dC5lY29yZVWQwWrDMBBE74H8g9ie YznupQgrOQQH
AimEJoFehbp2RC3JWGrt/n1XTlOwTmLnzbA75Xa0LfvGPhjvJKyzHBg67T+M ayRcL/vVC2w3
y0WJ2vcoqpPSn6pBNloj/l0FuZYLRo/CXBAkSrjF2AnOh2HIvG0y3zf8/fUA DyTMkeF5Ioo8
XxN2POsbWrUyLkTlNM7Sp01mZtSt6QJOCWjrlFLwKmHAnLIE4xj/Mly4vh3u A/qfeqzNKAE2
SS1x16oQTG3oMkYrivjTJff99kl8JFbU0/mrw/5CSJCQkCfOd8BTW3xeF41+ AVBLAwQUAAAA
CABXhWs5mYi7aFwAAABkAAAABwAAAGV4dC5lbWZzyEvMTS0uSExO1SgtyrRV Sq0oUdJRKChK
TcussFVS0uTlAsplJ6anKgBlrHm5eLkycwvyi0oUlJLzi1KVwCLJOYnFxQqu IBWpeSnFCiAZ
PWeFal4uBQUFXq5aAFBLAwQUAAAACAAdhms5S7zf6xYBAAAQAgAAEAAAAGV4 dC5tZXJnZWQu
ZWNvcmWdkVFLwzAUhd8F/0OIz1u6iiilcYxZobrh5jacTxLT2zbYpKXp1u7f m7RYrLAX38LN
Oec7N/GnjczQEUotckXxZOxgBIrnkVAJxbvt4+gOT+8vL3zgeQlesGL8iyWA Gim83uVal8lR
2jNzitOqKjxC6roe5zIZ52VC9suwl+ihpL5uFa7jTIxsseEpSDYSSldMcfhx tfyBD3gmCg2t
GWRsA1wSWBlu64mI4o/1y+FmtpiFQeSKt9un5fO72j+sMVJMmjRoKnPUu9ew P69KiEVDMTZL
I+TDPGNai1iYXZFp7lWnwhq712gv/9I+z9GCLtOmbg4FlFsTpVFqgBTbvCtC 5ph0XPIb/L8q
2TE4W6XjGMrgV83oG1BLAwQUAAAACAD8hWs54TAraqgAAAB6AQAAEgAAAE1l cmdlRXh0ZW5z
aW9uLmVvbHWPQQrCMBBF94XeIa6aguQAFhdS6lrwBGMyLcGpLUksPb4JQZmK 7jLz//t/soAT
enLYXUDfYUBxOIo2zrv3QgGR6q3zQdZNWSzRj2vg9m4N/9zZn/JbAu9tb9H5 xPBKxUWlaXrg
pyr5rs/bnJ0/UCYytCzYjdt8MOZEJL9uStAG4bkMYevcEz+vfIiKTK9xMkhn S6gczgQaZYUJ
q/aiGtENaFSe67p5AVBLAwQUAAAACAAbhms524muo3gBAAAXBAAAFQAAAE1l cmdlRXh0ZW5z
aW9uLmxhdW5jaNVTPW/CMBDdK/U/WEbq1jiBliLARS2ECcoCG4ubHMGqY0f2 hY9/XwMCAkxV
u3Sx7Lt37+6e9bq9Ta7ICqyTRnMaBSEloBOTSp1xOpsOH1uUOBQ6Fcpo4FQb 2nu9v+sqUepk
2Td6IbPSCvTlBLeFRxibBVA46fEBGBVAomThIEgxOBR56iA2anTLMAAFmUCg +w7S4RuilZ8l
AvmCLae5SUG5UzbWaLdkJVTp29YealGj44+wU5uWQD7MikQRiZrtp+d244X0 4ymph2HrDJNu
DCj2nEOp4F04SPlCKAdnjBY58L6xlZAFkU70yIiUoy0rCYceN9ED6QrjhLqm Ekr6Do6fI/mx
/cxKvkQs5m3G1uv1STIvJYN8wfzcdRYnF2PsxY7HwwrdcRPOxmAzOG3n2K7U s14QwKbw33q1
Q15VpDIqZT8VvdkOw9+IHm/wf2sOG/wDydmFDXYR5+86u3KGM6VNgB7/ZX41 zOHtJQW9M/rO
l0f6Wxf6+DdQSwECFAAUAAAACAAghWs5GQ19PIgAAADbAAAACAAAAAAAAAAB ACAAAAAAAAAA
LnByb2plY3RQSwECFAAUAAAACAA2hWs5FTFrgtUAAABUAQAACgAAAAAAAAAB ACAAAACuAAAA
Y29yZS5lY29yZVBLAQIUABQAAAAIADWFazlxurWnQwAAAEUAAAAIAAAAAAAA AAEAIAAAAKsB
AABjb3JlLmVtZlBLAQIUABQAAAAIANSFazn7hRaV5wAAAGkBAAAJAAAAAAAA AAEAIAAAABQC
AABleHQuZWNvcmVQSwECFAAUAAAACABXhWs5mYi7aFwAAABkAAAABwAAAAAA AAABACAAAAAi
AwAAZXh0LmVtZlBLAQIUABQAAAAIAB2GazlLvN/rFgEAABACAAAQAAAAAAAA AAEAIAAAAKMD
AABleHQubWVyZ2VkLmVjb3JlUEsBAhQAFAAAAAgA/IVrOeEwK2qoAAAAegEA ABIAAAAAAAAA
AQAgAAAA5wQAAE1lcmdlRXh0ZW5zaW9uLmVvbFBLAQIUABQAAAAIABuGaznb ia6jeAEAABcE
AAAVAAAAAAAAAAEAIAAAAL8FAABNZXJnZUV4dGVuc2lvbi5sYXVuY2hQSwUG AAAAAAgACADR
AQAAagcAAAAA
--------------000209080005090406070101--
Re: Copying models in ETL [message #561503 is a reply to message #2005] Tue, 11 November 2008 16:17 Go to previous message
Steffen Zschaler is currently offline Steffen ZschalerFriend
Messages: 266
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030005000309050801090702
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Dimitrios,

Thanks for the quick reply. I am actually generating ext. Would I be
able, then, to do this in the preamble of my ETL file, e.g.:

pre {
var coreEPackage := Core!EPackage.all.first();
var coreClassifiers := coreEPackage.eClassifiers.clone();
var coreSubpackages := coreEPackage.eSubpackages.clone();

var extEPackage := new Ext!EPackage;
extPackage.name := 'Bla';
extEPackage.eClassifiers.addAll(coreClassifiers);
extEPackage.eSubpackages.addAll(coreSubpackages);
}


Cheers,

Steffen

Dimitrios Kolovos wrote:
> Hi Steffen,
>
> I think that the most efficient way in your case is to load the two
> metamodels in an EOL program, move the eClassifiers and eSubpackages
> of the core metamodel to the extension metamodel and then save the
> extension metamodel using a different name. E.g.
>
> var coreEPackage := Core!EPackage.all.first();
> var extEPackage := Ext!EPackage.all.first();
>
> var coreClassifiers := coreEPackage.eClassifiers.clone();
> var coreSubpackages := coreEPackage.eSubpackages.clone();
>
> extEPackage.eClassifiers.addAll(coreClassifiers);
> extEPackage.eSubpackages.addAll(coreSubpackages);
>
> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>
> (just make sure you un-tick the Save on disposal checkbox when
> specifying the models)
>
> I've attached an example project (+launch configuration) that does
> this on two minimal core and ext metamodels.
>
> Hope this helps,
> Dimitrios
>
> Steffen Zschaler wrote:
>> Hi again,
>>
>> I have a core ecore metamodel and want to generate an extension
>> metamodel for this. This essentially means that I need to add a few
>> subclasses for some abstract classes in the core metamodel. As
>> discussed in earlier mails, I have a few tools that have problems
>> with ecore metamodels referencing each other. Hence, I cannot use
>> linking between the metamodels. Instead, I am planning to hack around
>> this by including a copy of all classes and relationships from the
>> core metamodel in my generated metamodel.
>>
>> What is the most efficient way of creating such a copy?
>>
>> Many thanks,
>>
>> Steffen
>>
>> Dimitrios Kolovos wrote:
>>> Hi Steffen,
>>>
>>> There are more than one ways to do this in ETL, EOL. Could you
>>> please give me a bit more details as to what you are trying to do so
>>> that I can suggest the best solution?
>>>
>>> I'd be grateful if we could take the discussion over to the
>>> eclipse.epsilon newsgroup as it sounds as something potentially
>>> interesting to others too (and also the more activity in the
>>> newsgroup, the better for the project ;)
>>>
>>> Cheers,
>>> Dimitrios
>>>
>>> Steffen Zschaler wrote:
>>>> Hi,
>>>>
>>>> Is there a possibility in ETL to create a copy of a source model to
>>>> be further expanded in the transformation?
>>>>
>>>> Many thanks,
>>>>
>>>> Steffen

--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
WWW http://www.steffen-zschaler.de/

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09


--------------030005000309050801090702
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Dimitrios,<br>
<br>
Thanks for the quick reply. I am actually generating ext. Would I be
able, then, to do this in the preamble of my ETL file, e.g.:<br>
<blockquote>
<pre>pre {
var coreEPackage := Core!EPackage.all.first();
var coreClassifiers := coreEPackage.eClassifiers.clone();
var coreSubpackages := coreEPackage.eSubpackages.clone();

var extEPackage := new Ext!EPackage;
extPackage.name := 'Bla';
extEPackage.eClassifiers.addAll(coreClassifiers);
extEPackage.eSubpackages.addAll(coreSubpackages);
}
</pre>
</blockquote>
Cheers,<br>
<br>
Steffen<br>
<br>
Dimitrios Kolovos wrote:
<blockquote cite="mid:gfc9pb$vev$1@build.eclipse.org" type="cite">Hi
Steffen,
<br>
<br>
I think that the most efficient way in your case is to load the two
metamodels in an EOL program, move the eClassifiers and eSubpackages of
the core metamodel to the extension metamodel and then save the
extension metamodel using a different name. E.g.
<br>
<br>
var coreEPackage := Core!EPackage.all.first();
<br>
var extEPackage := Ext!EPackage.all.first();
<br>
<br>
var coreClassifiers := coreEPackage.eClassifiers.clone();
<br>
var coreSubpackages := coreEPackage.eSubpackages.clone();
<br>
<br>
extEPackage.eClassifiers.addAll(coreClassifiers);
<br>
extEPackage.eSubpackages.addAll(coreSubpackages);
<br>
<br>
Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
<br>
<br>
(just make sure you un-tick the Save on disposal checkbox when
specifying the models)
<br>
<br>
I've attached an example project (+launch configuration) that does this
on two minimal core and ext metamodels.
<br>
<br>
Hope this helps,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi again,
<br>
<br>
I have a core ecore metamodel and want to generate an extension
metamodel for this. This essentially means that I need to add a few
subclasses for some abstract classes in the core metamodel. As
discussed in earlier mails, I have a few tools that have problems with
ecore metamodels referencing each other. Hence, I cannot use linking
between the metamodels. Instead, I am planning to hack around this by
including a copy of all classes and relationships from the core
metamodel in my generated metamodel.
<br>
<br>
What is the most efficient way of creating such a copy?
<br>
<br>
Many thanks,
<br>
<br>
Steffen
<br>
<br>
Dimitrios Kolovos wrote:
<br>
<blockquote type="cite">Hi Steffen,
<br>
<br>
There are more than one ways to do this in ETL, EOL. Could you please
give me a bit more details as to what you are trying to do so that I
can suggest the best solution?
<br>
<br>
I'd be grateful if we could take the discussion over to the
eclipse.epsilon newsgroup as it sounds as something potentially
interesting to others too (and also the more activity in the newsgroup,
the better for the project ;)
<br>
<br>
Cheers,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
Is there a possibility in ETL to create a copy of a source model to be
further expanded in the transformation?
<br>
<br>
Many thanks,
<br>
<br>
Steffen<br>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email <a class="moz-txt-link-abbreviated" href="mailto:szschaler@acm.org">szschaler@acm.org</a>
WWW <a class="moz-txt-link-freetext" href="http://www.steffen-zschaler.de/">http://www.steffen-zschaler.de/</a>

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
<a class="moz-txt-link-freetext" href="http://qosa.ipd.uka.de/">http://qosa.ipd.uka.de/</a>

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
<a class="moz-txt-link-freetext" href="http://wikiserver.sse.cs.tu-bs.de/mise09">http://wikiserver.sse.cs.tu-bs.de/mise09</a></pre>
</body>
</html>

--------------030005000309050801090702--
Re: Copying models in ETL [message #561537 is a reply to message #2019] Tue, 11 November 2008 16:23 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
I'd do this in the post section instead so that it runs after the ETL
rules. Otherwise the rules will have nothing to transform in the source
model. (Just make sure you don't store Core after the transformation is
done because by putting the classifiers and subpackages to ext you are
actually removing them from core).

Cheers,
Dimitrios

Steffen Zschaler wrote:
> Hi Dimitrios,
>
> Thanks for the quick reply. I am actually generating ext. Would I be
> able, then, to do this in the preamble of my ETL file, e.g.:
>
> pre {
> var coreEPackage := Core!EPackage.all.first();
> var coreClassifiers := coreEPackage.eClassifiers.clone();
> var coreSubpackages := coreEPackage.eSubpackages.clone();
>
> var extEPackage := new Ext!EPackage;
> extPackage.name := 'Bla';
> extEPackage.eClassifiers.addAll(coreClassifiers);
> extEPackage.eSubpackages.addAll(coreSubpackages);
> }
>
>
> Cheers,
>
> Steffen
>
> Dimitrios Kolovos wrote:
>> Hi Steffen,
>>
>> I think that the most efficient way in your case is to load the two
>> metamodels in an EOL program, move the eClassifiers and eSubpackages
>> of the core metamodel to the extension metamodel and then save the
>> extension metamodel using a different name. E.g.
>>
>> var coreEPackage := Core!EPackage.all.first();
>> var extEPackage := Ext!EPackage.all.first();
>>
>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>
>> extEPackage.eClassifiers.addAll(coreClassifiers);
>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>
>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>
>> (just make sure you un-tick the Save on disposal checkbox when
>> specifying the models)
>>
>> I've attached an example project (+launch configuration) that does
>> this on two minimal core and ext metamodels.
>>
>> Hope this helps,
>> Dimitrios
>>
>> Steffen Zschaler wrote:
>>> Hi again,
>>>
>>> I have a core ecore metamodel and want to generate an extension
>>> metamodel for this. This essentially means that I need to add a few
>>> subclasses for some abstract classes in the core metamodel. As
>>> discussed in earlier mails, I have a few tools that have problems
>>> with ecore metamodels referencing each other. Hence, I cannot use
>>> linking between the metamodels. Instead, I am planning to hack around
>>> this by including a copy of all classes and relationships from the
>>> core metamodel in my generated metamodel.
>>>
>>> What is the most efficient way of creating such a copy?
>>>
>>> Many thanks,
>>>
>>> Steffen
>>>
>>> Dimitrios Kolovos wrote:
>>>> Hi Steffen,
>>>>
>>>> There are more than one ways to do this in ETL, EOL. Could you
>>>> please give me a bit more details as to what you are trying to do so
>>>> that I can suggest the best solution?
>>>>
>>>> I'd be grateful if we could take the discussion over to the
>>>> eclipse.epsilon newsgroup as it sounds as something potentially
>>>> interesting to others too (and also the more activity in the
>>>> newsgroup, the better for the project ;)
>>>>
>>>> Cheers,
>>>> Dimitrios
>>>>
>>>> Steffen Zschaler wrote:
>>>>> Hi,
>>>>>
>>>>> Is there a possibility in ETL to create a copy of a source model to
>>>>> be further expanded in the transformation?
>>>>>
>>>>> Many thanks,
>>>>>
>>>>> Steffen
>
> --
> Dr. rer. nat. Steffen Zschaler
> Senior Research Associate
>
> Lancaster University
> Lancaster, United Kingdom
>
> Email szschaler@acm.org
> WWW http://www.steffen-zschaler.de/
>
> --
>
> Consider submitting to QoSA 2009, the 5th International Conference on
> the Quality of Software-Architectures.
> http://qosa.ipd.uka.de/
>
> Consider submitting to MiSE 2009, the 3rd International Workshop on
> Models in Software Engineering
> http://wikiserver.sse.cs.tu-bs.de/mise09
>
Re: Copying models in ETL [message #561596 is a reply to message #2047] Tue, 11 November 2008 16:28 Go to previous message
Steffen Zschaler is currently offline Steffen ZschalerFriend
Messages: 266
Registered: July 2009
Senior Member
Hi,

Thanks again. Not sure, I completely understand this. Why would there be
nothing to transform? The rules I am writing are not actually
transforming elements from Core, but rather are creating additional
elements based on information from a 'source' model. Am I right in
assuming that in this case I would be OK to do the copy in pre?

Cheers,

Steffen

Dimitrios Kolovos wrote:
> I'd do this in the post section instead so that it runs after the ETL
> rules. Otherwise the rules will have nothing to transform in the
> source model. (Just make sure you don't store Core after the
> transformation is done because by putting the classifiers and
> subpackages to ext you are actually removing them from core).
>
> Cheers,
> Dimitrios
>
> Steffen Zschaler wrote:
>> Hi Dimitrios,
>>
>> Thanks for the quick reply. I am actually generating ext. Would I be
>> able, then, to do this in the preamble of my ETL file, e.g.:
>>
>> pre {
>> var coreEPackage := Core!EPackage.all.first();
>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>
>> var extEPackage := new Ext!EPackage;
>> extPackage.name := 'Bla';
>> extEPackage.eClassifiers.addAll(coreClassifiers);
>> extEPackage.eSubpackages.addAll(coreSubpackages);
>> }
>>
>> Cheers,
>>
>> Steffen
>>
>> Dimitrios Kolovos wrote:
>>> Hi Steffen,
>>>
>>> I think that the most efficient way in your case is to load the two
>>> metamodels in an EOL program, move the eClassifiers and eSubpackages
>>> of the core metamodel to the extension metamodel and then save the
>>> extension metamodel using a different name. E.g.
>>>
>>> var coreEPackage := Core!EPackage.all.first();
>>> var extEPackage := Ext!EPackage.all.first();
>>>
>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>
>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>
>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>
>>> (just make sure you un-tick the Save on disposal checkbox when
>>> specifying the models)
>>>
>>> I've attached an example project (+launch configuration) that does
>>> this on two minimal core and ext metamodels.
>>>
>>> Hope this helps,
>>> Dimitrios
>>>
>>> Steffen Zschaler wrote:
>>>> Hi again,
>>>>
>>>> I have a core ecore metamodel and want to generate an extension
>>>> metamodel for this. This essentially means that I need to add a few
>>>> subclasses for some abstract classes in the core metamodel. As
>>>> discussed in earlier mails, I have a few tools that have problems
>>>> with ecore metamodels referencing each other. Hence, I cannot use
>>>> linking between the metamodels. Instead, I am planning to hack
>>>> around this by including a copy of all classes and relationships
>>>> from the core metamodel in my generated metamodel.
>>>>
>>>> What is the most efficient way of creating such a copy?
>>>>
>>>> Many thanks,
>>>>
>>>> Steffen
>>>>
>>>> Dimitrios Kolovos wrote:
>>>>> Hi Steffen,
>>>>>
>>>>> There are more than one ways to do this in ETL, EOL. Could you
>>>>> please give me a bit more details as to what you are trying to do
>>>>> so that I can suggest the best solution?
>>>>>
>>>>> I'd be grateful if we could take the discussion over to the
>>>>> eclipse.epsilon newsgroup as it sounds as something potentially
>>>>> interesting to others too (and also the more activity in the
>>>>> newsgroup, the better for the project ;)
>>>>>
>>>>> Cheers,
>>>>> Dimitrios
>>>>>
>>>>> Steffen Zschaler wrote:
>>>>>> Hi,
>>>>>>
>>>>>> Is there a possibility in ETL to create a copy of a source model
>>>>>> to be further expanded in the transformation?
>>>>>>
>>>>>> Many thanks,
>>>>>>
>>>>>> Steffen
>>
>> --
>> Dr. rer. nat. Steffen Zschaler
>> Senior Research Associate
>>
>> Lancaster University
>> Lancaster, United Kingdom
>>
>> Email szschaler@acm.org
>> WWW http://www.steffen-zschaler.de/
>>
>> --
>>
>> Consider submitting to QoSA 2009, the 5th International Conference on
>> the Quality of Software-Architectures.
>> http://qosa.ipd.uka.de/
>>
>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>> Models in Software Engineering
>> http://wikiserver.sse.cs.tu-bs.de/mise09

--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
WWW http://www.steffen-zschaler.de/

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09
Re: Copying models in ETL [message #561631 is a reply to message #2089] Tue, 11 November 2008 16:35 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Oh! I made the assumption that your source model would be Core. Since it
is not, putting the code either in pre or post should be fine.

Cheers,
Dimitrios

Steffen Zschaler wrote:
> Hi,
>
> Thanks again. Not sure, I completely understand this. Why would there be
> nothing to transform? The rules I am writing are not actually
> transforming elements from Core, but rather are creating additional
> elements based on information from a 'source' model. Am I right in
> assuming that in this case I would be OK to do the copy in pre?
>
> Cheers,
>
> Steffen
>
> Dimitrios Kolovos wrote:
>> I'd do this in the post section instead so that it runs after the ETL
>> rules. Otherwise the rules will have nothing to transform in the
>> source model. (Just make sure you don't store Core after the
>> transformation is done because by putting the classifiers and
>> subpackages to ext you are actually removing them from core).
>>
>> Cheers,
>> Dimitrios
>>
>> Steffen Zschaler wrote:
>>> Hi Dimitrios,
>>>
>>> Thanks for the quick reply. I am actually generating ext. Would I be
>>> able, then, to do this in the preamble of my ETL file, e.g.:
>>>
>>> pre {
>>> var coreEPackage := Core!EPackage.all.first();
>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>
>>> var extEPackage := new Ext!EPackage;
>>> extPackage.name := 'Bla';
>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>> }
>>> Cheers,
>>>
>>> Steffen
>>>
>>> Dimitrios Kolovos wrote:
>>>> Hi Steffen,
>>>>
>>>> I think that the most efficient way in your case is to load the two
>>>> metamodels in an EOL program, move the eClassifiers and eSubpackages
>>>> of the core metamodel to the extension metamodel and then save the
>>>> extension metamodel using a different name. E.g.
>>>>
>>>> var coreEPackage := Core!EPackage.all.first();
>>>> var extEPackage := Ext!EPackage.all.first();
>>>>
>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>
>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>
>>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>>
>>>> (just make sure you un-tick the Save on disposal checkbox when
>>>> specifying the models)
>>>>
>>>> I've attached an example project (+launch configuration) that does
>>>> this on two minimal core and ext metamodels.
>>>>
>>>> Hope this helps,
>>>> Dimitrios
>>>>
>>>> Steffen Zschaler wrote:
>>>>> Hi again,
>>>>>
>>>>> I have a core ecore metamodel and want to generate an extension
>>>>> metamodel for this. This essentially means that I need to add a few
>>>>> subclasses for some abstract classes in the core metamodel. As
>>>>> discussed in earlier mails, I have a few tools that have problems
>>>>> with ecore metamodels referencing each other. Hence, I cannot use
>>>>> linking between the metamodels. Instead, I am planning to hack
>>>>> around this by including a copy of all classes and relationships
>>>>> from the core metamodel in my generated metamodel.
>>>>>
>>>>> What is the most efficient way of creating such a copy?
>>>>>
>>>>> Many thanks,
>>>>>
>>>>> Steffen
>>>>>
>>>>> Dimitrios Kolovos wrote:
>>>>>> Hi Steffen,
>>>>>>
>>>>>> There are more than one ways to do this in ETL, EOL. Could you
>>>>>> please give me a bit more details as to what you are trying to do
>>>>>> so that I can suggest the best solution?
>>>>>>
>>>>>> I'd be grateful if we could take the discussion over to the
>>>>>> eclipse.epsilon newsgroup as it sounds as something potentially
>>>>>> interesting to others too (and also the more activity in the
>>>>>> newsgroup, the better for the project ;)
>>>>>>
>>>>>> Cheers,
>>>>>> Dimitrios
>>>>>>
>>>>>> Steffen Zschaler wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> Is there a possibility in ETL to create a copy of a source model
>>>>>>> to be further expanded in the transformation?
>>>>>>>
>>>>>>> Many thanks,
>>>>>>>
>>>>>>> Steffen
>>>
>>> --
>>> Dr. rer. nat. Steffen Zschaler
>>> Senior Research Associate
>>>
>>> Lancaster University
>>> Lancaster, United Kingdom
>>>
>>> Email szschaler@acm.org
>>> WWW http://www.steffen-zschaler.de/
>>>
>>> --
>>>
>>> Consider submitting to QoSA 2009, the 5th International Conference on
>>> the Quality of Software-Architectures.
>>> http://qosa.ipd.uka.de/
>>>
>>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>>> Models in Software Engineering
>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>
Re: Copying models in ETL [message #561649 is a reply to message #3110] Tue, 11 November 2008 16:44 Go to previous message
Steffen Zschaler is currently offline Steffen ZschalerFriend
Messages: 266
Registered: July 2009
Senior Member
Thanks,

Steffen

Dimitrios Kolovos wrote:
> Oh! I made the assumption that your source model would be Core. Since
> it is not, putting the code either in pre or post should be fine.
>
> Cheers,
> Dimitrios
>
> Steffen Zschaler wrote:
>> Hi,
>>
>> Thanks again. Not sure, I completely understand this. Why would there
>> be nothing to transform? The rules I am writing are not actually
>> transforming elements from Core, but rather are creating additional
>> elements based on information from a 'source' model. Am I right in
>> assuming that in this case I would be OK to do the copy in pre?
>>
>> Cheers,
>>
>> Steffen
>>
>> Dimitrios Kolovos wrote:
>>> I'd do this in the post section instead so that it runs after the
>>> ETL rules. Otherwise the rules will have nothing to transform in the
>>> source model. (Just make sure you don't store Core after the
>>> transformation is done because by putting the classifiers and
>>> subpackages to ext you are actually removing them from core).
>>>
>>> Cheers,
>>> Dimitrios
>>>
>>> Steffen Zschaler wrote:
>>>> Hi Dimitrios,
>>>>
>>>> Thanks for the quick reply. I am actually generating ext. Would I
>>>> be able, then, to do this in the preamble of my ETL file, e.g.:
>>>>
>>>> pre {
>>>> var coreEPackage := Core!EPackage.all.first();
>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>
>>>> var extEPackage := new Ext!EPackage;
>>>> extPackage.name := 'Bla';
>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>> }
>>>> Cheers,
>>>>
>>>> Steffen
>>>>
>>>> Dimitrios Kolovos wrote:
>>>>> Hi Steffen,
>>>>>
>>>>> I think that the most efficient way in your case is to load the
>>>>> two metamodels in an EOL program, move the eClassifiers and
>>>>> eSubpackages of the core metamodel to the extension metamodel and
>>>>> then save the extension metamodel using a different name. E.g.
>>>>>
>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>> var extEPackage := Ext!EPackage.all.first();
>>>>>
>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>
>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>
>>>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>>>
>>>>> (just make sure you un-tick the Save on disposal checkbox when
>>>>> specifying the models)
>>>>>
>>>>> I've attached an example project (+launch configuration) that does
>>>>> this on two minimal core and ext metamodels.
>>>>>
>>>>> Hope this helps,
>>>>> Dimitrios
>>>>>
>>>>> Steffen Zschaler wrote:
>>>>>> Hi again,
>>>>>>
>>>>>> I have a core ecore metamodel and want to generate an extension
>>>>>> metamodel for this. This essentially means that I need to add a
>>>>>> few subclasses for some abstract classes in the core metamodel.
>>>>>> As discussed in earlier mails, I have a few tools that have
>>>>>> problems with ecore metamodels referencing each other. Hence, I
>>>>>> cannot use linking between the metamodels. Instead, I am planning
>>>>>> to hack around this by including a copy of all classes and
>>>>>> relationships from the core metamodel in my generated metamodel.
>>>>>>
>>>>>> What is the most efficient way of creating such a copy?
>>>>>>
>>>>>> Many thanks,
>>>>>>
>>>>>> Steffen
>>>>>>
>>>>>> Dimitrios Kolovos wrote:
>>>>>>> Hi Steffen,
>>>>>>>
>>>>>>> There are more than one ways to do this in ETL, EOL. Could you
>>>>>>> please give me a bit more details as to what you are trying to
>>>>>>> do so that I can suggest the best solution?
>>>>>>>
>>>>>>> I'd be grateful if we could take the discussion over to the
>>>>>>> eclipse.epsilon newsgroup as it sounds as something potentially
>>>>>>> interesting to others too (and also the more activity in the
>>>>>>> newsgroup, the better for the project ;)
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Dimitrios
>>>>>>>
>>>>>>> Steffen Zschaler wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Is there a possibility in ETL to create a copy of a source
>>>>>>>> model to be further expanded in the transformation?
>>>>>>>>
>>>>>>>> Many thanks,
>>>>>>>>
>>>>>>>> Steffen
>>>>
>>>> --
>>>> Dr. rer. nat. Steffen Zschaler
>>>> Senior Research Associate
>>>>
>>>> Lancaster University
>>>> Lancaster, United Kingdom
>>>>
>>>> Email szschaler@acm.org
>>>> WWW http://www.steffen-zschaler.de/
>>>>
>>>> --
>>>>
>>>> Consider submitting to QoSA 2009, the 5th International Conference on
>>>> the Quality of Software-Architectures.
>>>> http://qosa.ipd.uka.de/
>>>>
>>>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>>>> Models in Software Engineering
>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>


--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
WWW http://www.steffen-zschaler.de/

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09
Re: Copying models in ETL [message #561786 is a reply to message #3110] Wed, 12 November 2008 11:55 Go to previous message
Steffen Zschaler is currently offline Steffen ZschalerFriend
Messages: 266
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090907000804080207050102
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

It seems I'm still doing something wrong here. Here's the code I put
into pre:

pre {
var coreEPackage := Core!EPackage.all.first();
var coreClassifiers := coreEPackage.eClassifiers.clone();
var coreSubpackages := coreEPackage.eSubpackages.clone();

-- Copy Core Metamodel
var extEPackage := new target!EPackage;
extPackage.name := 'Bla';
extEPackage.eClassifiers.addAll(coreClassifiers);
extEPackage.eSubpackages.addAll(coreSubpackages);
}


However, all I get is an empty resulting model.

Any ideas where the error could be?

Steffen

Dimitrios Kolovos wrote:
> Oh! I made the assumption that your source model would be Core. Since
> it is not, putting the code either in pre or post should be fine.
>
> Cheers,
> Dimitrios
>
> Steffen Zschaler wrote:
>> Hi,
>>
>> Thanks again. Not sure, I completely understand this. Why would there
>> be nothing to transform? The rules I am writing are not actually
>> transforming elements from Core, but rather are creating additional
>> elements based on information from a 'source' model. Am I right in
>> assuming that in this case I would be OK to do the copy in pre?
>>
>> Cheers,
>>
>> Steffen
>>
>> Dimitrios Kolovos wrote:
>>> I'd do this in the post section instead so that it runs after the
>>> ETL rules. Otherwise the rules will have nothing to transform in the
>>> source model. (Just make sure you don't store Core after the
>>> transformation is done because by putting the classifiers and
>>> subpackages to ext you are actually removing them from core).
>>>
>>> Cheers,
>>> Dimitrios
>>>
>>> Steffen Zschaler wrote:
>>>> Hi Dimitrios,
>>>>
>>>> Thanks for the quick reply. I am actually generating ext. Would I
>>>> be able, then, to do this in the preamble of my ETL file, e.g.:
>>>>
>>>> pre {
>>>> var coreEPackage := Core!EPackage.all.first();
>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>
>>>> var extEPackage := new Ext!EPackage;
>>>> extPackage.name := 'Bla';
>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>> }
>>>> Cheers,
>>>>
>>>> Steffen
>>>>
>>>> Dimitrios Kolovos wrote:
>>>>> Hi Steffen,
>>>>>
>>>>> I think that the most efficient way in your case is to load the
>>>>> two metamodels in an EOL program, move the eClassifiers and
>>>>> eSubpackages of the core metamodel to the extension metamodel and
>>>>> then save the extension metamodel using a different name. E.g.
>>>>>
>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>> var extEPackage := Ext!EPackage.all.first();
>>>>>
>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>
>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>
>>>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>>>
>>>>> (just make sure you un-tick the Save on disposal checkbox when
>>>>> specifying the models)
>>>>>
>>>>> I've attached an example project (+launch configuration) that does
>>>>> this on two minimal core and ext metamodels.
>>>>>
>>>>> Hope this helps,
>>>>> Dimitrios
>>>>>
>>>>> Steffen Zschaler wrote:
>>>>>> Hi again,
>>>>>>
>>>>>> I have a core ecore metamodel and want to generate an extension
>>>>>> metamodel for this. This essentially means that I need to add a
>>>>>> few subclasses for some abstract classes in the core metamodel.
>>>>>> As discussed in earlier mails, I have a few tools that have
>>>>>> problems with ecore metamodels referencing each other. Hence, I
>>>>>> cannot use linking between the metamodels. Instead, I am planning
>>>>>> to hack around this by including a copy of all classes and
>>>>>> relationships from the core metamodel in my generated metamodel.
>>>>>>
>>>>>> What is the most efficient way of creating such a copy?
>>>>>>
>>>>>> Many thanks,
>>>>>>
>>>>>> Steffen
>>>>>>
>>>>>> Dimitrios Kolovos wrote:
>>>>>>> Hi Steffen,
>>>>>>>
>>>>>>> There are more than one ways to do this in ETL, EOL. Could you
>>>>>>> please give me a bit more details as to what you are trying to
>>>>>>> do so that I can suggest the best solution?
>>>>>>>
>>>>>>> I'd be grateful if we could take the discussion over to the
>>>>>>> eclipse.epsilon newsgroup as it sounds as something potentially
>>>>>>> interesting to others too (and also the more activity in the
>>>>>>> newsgroup, the better for the project ;)
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Dimitrios
>>>>>>>
>>>>>>> Steffen Zschaler wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Is there a possibility in ETL to create a copy of a source
>>>>>>>> model to be further expanded in the transformation?
>>>>>>>>
>>>>>>>> Many thanks,
>>>>>>>>
>>>>>>>> Steffen
>>>>
>>>> --
>>>> Dr. rer. nat. Steffen Zschaler
>>>> Senior Research Associate
>>>>
>>>> Lancaster University
>>>> Lancaster, United Kingdom
>>>>
>>>> Email szschaler@acm.org
>>>> WWW http://www.steffen-zschaler.de/
>>>>
>>>> --
>>>>
>>>> Consider submitting to QoSA 2009, the 5th International Conference on
>>>> the Quality of Software-Architectures.
>>>> http://qosa.ipd.uka.de/
>>>>
>>>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>>>> Models in Software Engineering
>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>

--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
WWW http://www.steffen-zschaler.de/

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09


--------------090907000804080207050102
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
It seems I'm still doing something wrong here. Here's the code I put
into pre:<br>
<blockquote>
<pre>pre {
var coreEPackage := Core!EPackage.all.first();
var coreClassifiers := coreEPackage.eClassifiers.clone();
var coreSubpackages := coreEPackage.eSubpackages.clone();

-- Copy Core Metamodel
var extEPackage := new target!EPackage;
extPackage.name := 'Bla';
extEPackage.eClassifiers.addAll(coreClassifiers);
extEPackage.eSubpackages.addAll(coreSubpackages);
}
</pre>
</blockquote>
However, all I get is an empty resulting model.<br>
<br>
Any ideas where the error could be?<br>
<br>
Steffen<br>
<br>
Dimitrios Kolovos wrote:
<blockquote cite="mid:gfcc9j$pj0$3@build.eclipse.org" type="cite">Oh! I
made the assumption that your source model would be Core. Since it is
not, putting the code either in pre or post should be fine.
<br>
<br>
Cheers,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
Thanks again. Not sure, I completely understand this. Why would there
be nothing to transform? The rules I am writing are not actually
transforming elements from Core, but rather are creating additional
elements based on information from a 'source' model. Am I right in
assuming that in this case I would be OK to do the copy in pre?
<br>
<br>
Cheers,
<br>
<br>
Steffen
<br>
<br>
Dimitrios Kolovos wrote:
<br>
<blockquote type="cite">I'd do this in the post section instead so
that it runs after the ETL rules. Otherwise the rules will have nothing
to transform in the source model. (Just make sure you don't store Core
after the transformation is done because by putting the classifiers and
subpackages to ext you are actually removing them from core).
<br>
<br>
Cheers,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi Dimitrios,
<br>
<br>
Thanks for the quick reply. I am actually generating ext. Would I be
able, then, to do this in the preamble of my ETL file, e.g.:
<br>
<br>
&nbsp;&nbsp;&nbsp; pre {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var coreEPackage := Core!EPackage.all.first();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var coreClassifiers := coreEPackage.eClassifiers.clone();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var coreSubpackages := coreEPackage.eSubpackages.clone();
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var extEPackage := new Ext!EPackage;
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extPackage.name := 'Bla';
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extEPackage.eClassifiers.addAll(coreClassifiers);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extEPackage.eSubpackages.addAll(coreSubpackages);
<br>
&nbsp;&nbsp;&nbsp; }
<br>
&nbsp;&nbsp;&nbsp;&nbsp; Cheers,
<br>
<br>
Steffen
<br>
<br>
Dimitrios Kolovos wrote:
<br>
<blockquote type="cite">Hi Steffen,
<br>
<br>
I think that the most efficient way in your case is to load the two
metamodels in an EOL program, move the eClassifiers and eSubpackages of
the core metamodel to the extension metamodel and then save the
extension metamodel using a different name. E.g.
<br>
<br>
var coreEPackage := Core!EPackage.all.first();
<br>
var extEPackage := Ext!EPackage.all.first();
<br>
<br>
var coreClassifiers := coreEPackage.eClassifiers.clone();
<br>
var coreSubpackages := coreEPackage.eSubpackages.clone();
<br>
<br>
extEPackage.eClassifiers.addAll(coreClassifiers);
<br>
extEPackage.eSubpackages.addAll(coreSubpackages);
<br>
<br>
Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
<br>
<br>
(just make sure you un-tick the Save on disposal checkbox when
specifying the models)
<br>
<br>
I've attached an example project (+launch configuration) that does this
on two minimal core and ext metamodels.
<br>
<br>
Hope this helps,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi again,
<br>
<br>
I have a core ecore metamodel and want to generate an extension
metamodel for this. This essentially means that I need to add a few
subclasses for some abstract classes in the core metamodel. As
discussed in earlier mails, I have a few tools that have problems with
ecore metamodels referencing each other. Hence, I cannot use linking
between the metamodels. Instead, I am planning to hack around this by
including a copy of all classes and relationships from the core
metamodel in my generated metamodel.
<br>
<br>
What is the most efficient way of creating such a copy?
<br>
<br>
Many thanks,
<br>
<br>
Steffen
<br>
<br>
Dimitrios Kolovos wrote:
<br>
<blockquote type="cite">Hi Steffen,
<br>
<br>
There are more than one ways to do this in ETL, EOL. Could you please
give me a bit more details as to what you are trying to do so that I
can suggest the best solution?
<br>
<br>
I'd be grateful if we could take the discussion over to the
eclipse.epsilon newsgroup as it sounds as something potentially
interesting to others too (and also the more activity in the newsgroup,
the better for the project ;)
<br>
<br>
Cheers,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
Is there a possibility in ETL to create a copy of a source model to be
further expanded in the transformation?
<br>
<br>
Many thanks,
<br>
<br>
Steffen
<br>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<br>
--&nbsp;<br>
Dr. rer. nat. Steffen Zschaler
<br>
Senior Research Associate
<br>
<br>
Lancaster University
<br>
Lancaster, United Kingdom
<br>
<br>
Email <a class="moz-txt-link-abbreviated" href="mailto:szschaler@acm.org">szschaler@acm.org</a>
<br>
WWW&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="http://www.steffen-zschaler.de/">http://www.steffen-zschaler.de/</a>
<br>
<br>
--&nbsp;<br>
<br>
Consider submitting to QoSA 2009, the 5th International Conference on
<br>
the Quality of Software-Architectures.
<br>
<a class="moz-txt-link-freetext" href="http://qosa.ipd.uka.de/">http://qosa.ipd.uka.de/</a>
<br>
<br>
Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
<br>
<a class="moz-txt-link-freetext" href="http://wikiserver.sse.cs.tu-bs.de/mise09">http://wikiserver.sse.cs.tu-bs.de/mise09</a>
<br>
</blockquote>
</blockquote>
<br>
</blockquote>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email <a class="moz-txt-link-abbreviated" href="mailto:szschaler@acm.org">szschaler@acm.org</a>
WWW <a class="moz-txt-link-freetext" href="http://www.steffen-zschaler.de/">http://www.steffen-zschaler.de/</a>

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
<a class="moz-txt-link-freetext" href="http://qosa.ipd.uka.de/">http://qosa.ipd.uka.de/</a>

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
<a class="moz-txt-link-freetext" href="http://wikiserver.sse.cs.tu-bs.de/mise09">http://wikiserver.sse.cs.tu-bs.de/mise09</a></pre>
</body>
</html>

--------------090907000804080207050102--
Re: Copying models in ETL [message #561846 is a reply to message #3377] Wed, 12 November 2008 13:13 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Steffen,

The only thing that comes to mind is that you don't store target when
the transformation ends. Could you please add a few print statements after

extEPackage.eSubpackages.addAll(coreSubpackages);

to see the state of your model once the statements above have executed?

e.g.

extEPackage.eClassifiers.println();

If the problem persists, could you please send me your transformation
and involved models/metamodels so that I can investigate more?

Cheers,
Dimitrios

Steffen Zschaler wrote:
> Hi,
>
> It seems I'm still doing something wrong here. Here's the code I put
> into pre:
>
> pre {
> var coreEPackage := Core!EPackage.all.first();
> var coreClassifiers := coreEPackage.eClassifiers.clone();
> var coreSubpackages := coreEPackage.eSubpackages.clone();
>
> -- Copy Core Metamodel
> var extEPackage := new target!EPackage;
> extPackage.name := 'Bla';
> extEPackage.eClassifiers.addAll(coreClassifiers);
> extEPackage.eSubpackages.addAll(coreSubpackages);
> }
>
>
> However, all I get is an empty resulting model.
>
> Any ideas where the error could be?
>
> Steffen
>
> Dimitrios Kolovos wrote:
>> Oh! I made the assumption that your source model would be Core. Since
>> it is not, putting the code either in pre or post should be fine.
>>
>> Cheers,
>> Dimitrios
>>
>> Steffen Zschaler wrote:
>>> Hi,
>>>
>>> Thanks again. Not sure, I completely understand this. Why would there
>>> be nothing to transform? The rules I am writing are not actually
>>> transforming elements from Core, but rather are creating additional
>>> elements based on information from a 'source' model. Am I right in
>>> assuming that in this case I would be OK to do the copy in pre?
>>>
>>> Cheers,
>>>
>>> Steffen
>>>
>>> Dimitrios Kolovos wrote:
>>>> I'd do this in the post section instead so that it runs after the
>>>> ETL rules. Otherwise the rules will have nothing to transform in the
>>>> source model. (Just make sure you don't store Core after the
>>>> transformation is done because by putting the classifiers and
>>>> subpackages to ext you are actually removing them from core).
>>>>
>>>> Cheers,
>>>> Dimitrios
>>>>
>>>> Steffen Zschaler wrote:
>>>>> Hi Dimitrios,
>>>>>
>>>>> Thanks for the quick reply. I am actually generating ext. Would I
>>>>> be able, then, to do this in the preamble of my ETL file, e.g.:
>>>>>
>>>>> pre {
>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>
>>>>> var extEPackage := new Ext!EPackage;
>>>>> extPackage.name := 'Bla';
>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>> }
>>>>> Cheers,
>>>>>
>>>>> Steffen
>>>>>
>>>>> Dimitrios Kolovos wrote:
>>>>>> Hi Steffen,
>>>>>>
>>>>>> I think that the most efficient way in your case is to load the
>>>>>> two metamodels in an EOL program, move the eClassifiers and
>>>>>> eSubpackages of the core metamodel to the extension metamodel and
>>>>>> then save the extension metamodel using a different name. E.g.
>>>>>>
>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>> var extEPackage := Ext!EPackage.all.first();
>>>>>>
>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>
>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>>
>>>>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>>>>
>>>>>> (just make sure you un-tick the Save on disposal checkbox when
>>>>>> specifying the models)
>>>>>>
>>>>>> I've attached an example project (+launch configuration) that does
>>>>>> this on two minimal core and ext metamodels.
>>>>>>
>>>>>> Hope this helps,
>>>>>> Dimitrios
>>>>>>
>>>>>> Steffen Zschaler wrote:
>>>>>>> Hi again,
>>>>>>>
>>>>>>> I have a core ecore metamodel and want to generate an extension
>>>>>>> metamodel for this. This essentially means that I need to add a
>>>>>>> few subclasses for some abstract classes in the core metamodel.
>>>>>>> As discussed in earlier mails, I have a few tools that have
>>>>>>> problems with ecore metamodels referencing each other. Hence, I
>>>>>>> cannot use linking between the metamodels. Instead, I am planning
>>>>>>> to hack around this by including a copy of all classes and
>>>>>>> relationships from the core metamodel in my generated metamodel.
>>>>>>>
>>>>>>> What is the most efficient way of creating such a copy?
>>>>>>>
>>>>>>> Many thanks,
>>>>>>>
>>>>>>> Steffen
>>>>>>>
>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>> Hi Steffen,
>>>>>>>>
>>>>>>>> There are more than one ways to do this in ETL, EOL. Could you
>>>>>>>> please give me a bit more details as to what you are trying to
>>>>>>>> do so that I can suggest the best solution?
>>>>>>>>
>>>>>>>> I'd be grateful if we could take the discussion over to the
>>>>>>>> eclipse.epsilon newsgroup as it sounds as something potentially
>>>>>>>> interesting to others too (and also the more activity in the
>>>>>>>> newsgroup, the better for the project ;)
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>> Dimitrios
>>>>>>>>
>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> Is there a possibility in ETL to create a copy of a source
>>>>>>>>> model to be further expanded in the transformation?
>>>>>>>>>
>>>>>>>>> Many thanks,
>>>>>>>>>
>>>>>>>>> Steffen
>>>>>
>>>>> --
>>>>> Dr. rer. nat. Steffen Zschaler
>>>>> Senior Research Associate
>>>>>
>>>>> Lancaster University
>>>>> Lancaster, United Kingdom
>>>>>
>>>>> Email szschaler@acm.org
>>>>> WWW http://www.steffen-zschaler.de/
>>>>>
>>>>> --
>>>>>
>>>>> Consider submitting to QoSA 2009, the 5th International Conference on
>>>>> the Quality of Software-Architectures.
>>>>> http://qosa.ipd.uka.de/
>>>>>
>>>>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>>>>> Models in Software Engineering
>>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>>
>
> --
> Dr. rer. nat. Steffen Zschaler
> Senior Research Associate
>
> Lancaster University
> Lancaster, United Kingdom
>
> Email szschaler@acm.org
> WWW http://www.steffen-zschaler.de/
>
> --
>
> Consider submitting to QoSA 2009, the 5th International Conference on
> the Quality of Software-Architectures.
> http://qosa.ipd.uka.de/
>
> Consider submitting to MiSE 2009, the 3rd International Workshop on
> Models in Software Engineering
> http://wikiserver.sse.cs.tu-bs.de/mise09
>
Re: Copying models in ETL [message #561906 is a reply to message #3481] Wed, 12 November 2008 13:27 Go to previous message
Steffen Zschaler is currently offline Steffen ZschalerFriend
Messages: 266
Registered: July 2009
Senior Member
Hi,

No output at all from println statement (even from something like
'Test'.println()). So it seems like I am making a mistake in setting up
the actual transformation and the transformation is never run.

Cheers,

Steffen

Dimitrios Kolovos wrote:
> Hi Steffen,
>
> The only thing that comes to mind is that you don't store target when
> the transformation ends. Could you please add a few print statements
> after
>
> extEPackage.eSubpackages.addAll(coreSubpackages);
>
> to see the state of your model once the statements above have executed?
>
> e.g.
>
> extEPackage.eClassifiers.println();
>
> If the problem persists, could you please send me your transformation
> and involved models/metamodels so that I can investigate more?
>
> Cheers,
> Dimitrios
>
> Steffen Zschaler wrote:
>> Hi,
>>
>> It seems I'm still doing something wrong here. Here's the code I put
>> into pre:
>>
>> pre {
>> var coreEPackage := Core!EPackage.all.first();
>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>
>> -- Copy Core Metamodel
>> var extEPackage := new target!EPackage;
>> extPackage.name := 'Bla';
>> extEPackage.eClassifiers.addAll(coreClassifiers);
>> extEPackage.eSubpackages.addAll(coreSubpackages);
>> }
>>
>> However, all I get is an empty resulting model.
>>
>> Any ideas where the error could be?
>>
>> Steffen
>>
>> Dimitrios Kolovos wrote:
>>> Oh! I made the assumption that your source model would be Core.
>>> Since it is not, putting the code either in pre or post should be fine.
>>>
>>> Cheers,
>>> Dimitrios
>>>
>>> Steffen Zschaler wrote:
>>>> Hi,
>>>>
>>>> Thanks again. Not sure, I completely understand this. Why would
>>>> there be nothing to transform? The rules I am writing are not
>>>> actually transforming elements from Core, but rather are creating
>>>> additional elements based on information from a 'source' model. Am
>>>> I right in assuming that in this case I would be OK to do the copy
>>>> in pre?
>>>>
>>>> Cheers,
>>>>
>>>> Steffen
>>>>
>>>> Dimitrios Kolovos wrote:
>>>>> I'd do this in the post section instead so that it runs after the
>>>>> ETL rules. Otherwise the rules will have nothing to transform in
>>>>> the source model. (Just make sure you don't store Core after the
>>>>> transformation is done because by putting the classifiers and
>>>>> subpackages to ext you are actually removing them from core).
>>>>>
>>>>> Cheers,
>>>>> Dimitrios
>>>>>
>>>>> Steffen Zschaler wrote:
>>>>>> Hi Dimitrios,
>>>>>>
>>>>>> Thanks for the quick reply. I am actually generating ext. Would I
>>>>>> be able, then, to do this in the preamble of my ETL file, e.g.:
>>>>>>
>>>>>> pre {
>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>
>>>>>> var extEPackage := new Ext!EPackage;
>>>>>> extPackage.name := 'Bla';
>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>> }
>>>>>> Cheers,
>>>>>>
>>>>>> Steffen
>>>>>>
>>>>>> Dimitrios Kolovos wrote:
>>>>>>> Hi Steffen,
>>>>>>>
>>>>>>> I think that the most efficient way in your case is to load the
>>>>>>> two metamodels in an EOL program, move the eClassifiers and
>>>>>>> eSubpackages of the core metamodel to the extension metamodel
>>>>>>> and then save the extension metamodel using a different name. E.g.
>>>>>>>
>>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>>> var extEPackage := Ext!EPackage.all.first();
>>>>>>>
>>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>>
>>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>>>
>>>>>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>>>>>
>>>>>>> (just make sure you un-tick the Save on disposal checkbox when
>>>>>>> specifying the models)
>>>>>>>
>>>>>>> I've attached an example project (+launch configuration) that
>>>>>>> does this on two minimal core and ext metamodels.
>>>>>>>
>>>>>>> Hope this helps,
>>>>>>> Dimitrios
>>>>>>>
>>>>>>> Steffen Zschaler wrote:
>>>>>>>> Hi again,
>>>>>>>>
>>>>>>>> I have a core ecore metamodel and want to generate an extension
>>>>>>>> metamodel for this. This essentially means that I need to add a
>>>>>>>> few subclasses for some abstract classes in the core metamodel.
>>>>>>>> As discussed in earlier mails, I have a few tools that have
>>>>>>>> problems with ecore metamodels referencing each other. Hence, I
>>>>>>>> cannot use linking between the metamodels. Instead, I am
>>>>>>>> planning to hack around this by including a copy of all classes
>>>>>>>> and relationships from the core metamodel in my generated
>>>>>>>> metamodel.
>>>>>>>>
>>>>>>>> What is the most efficient way of creating such a copy?
>>>>>>>>
>>>>>>>> Many thanks,
>>>>>>>>
>>>>>>>> Steffen
>>>>>>>>
>>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>>> Hi Steffen,
>>>>>>>>>
>>>>>>>>> There are more than one ways to do this in ETL, EOL. Could you
>>>>>>>>> please give me a bit more details as to what you are trying to
>>>>>>>>> do so that I can suggest the best solution?
>>>>>>>>>
>>>>>>>>> I'd be grateful if we could take the discussion over to the
>>>>>>>>> eclipse.epsilon newsgroup as it sounds as something
>>>>>>>>> potentially interesting to others too (and also the more
>>>>>>>>> activity in the newsgroup, the better for the project ;)
>>>>>>>>>
>>>>>>>>> Cheers,
>>>>>>>>> Dimitrios
>>>>>>>>>
>>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> Is there a possibility in ETL to create a copy of a source
>>>>>>>>>> model to be further expanded in the transformation?
>>>>>>>>>>
>>>>>>>>>> Many thanks,
>>>>>>>>>>
>>>>>>>>>> Steffen
>>>>>>
>>>>>> --
>>>>>> Dr. rer. nat. Steffen Zschaler
>>>>>> Senior Research Associate
>>>>>>
>>>>>> Lancaster University
>>>>>> Lancaster, United Kingdom
>>>>>>
>>>>>> Email szschaler@acm.org
>>>>>> WWW http://www.steffen-zschaler.de/
>>>>>>
>>>>>> --
>>>>>>
>>>>>> Consider submitting to QoSA 2009, the 5th International
>>>>>> Conference on
>>>>>> the Quality of Software-Architectures.
>>>>>> http://qosa.ipd.uka.de/
>>>>>>
>>>>>> Consider submitting to MiSE 2009, the 3rd International Workshop
>>>>>> on Models in Software Engineering
>>>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>>>
>>
>> --
>> Dr. rer. nat. Steffen Zschaler
>> Senior Research Associate
>>
>> Lancaster University
>> Lancaster, United Kingdom
>>
>> Email szschaler@acm.org
>> WWW http://www.steffen-zschaler.de/
>>
>> --
>>
>> Consider submitting to QoSA 2009, the 5th International Conference on
>> the Quality of Software-Architectures.
>> http://qosa.ipd.uka.de/
>>
>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>> Models in Software Engineering
>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>

--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
WWW http://www.steffen-zschaler.de/

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09
Re: Copying models in ETL [message #561928 is a reply to message #3481] Wed, 12 November 2008 13:37 Go to previous message
Steffen Zschaler is currently offline Steffen ZschalerFriend
Messages: 266
Registered: July 2009
Senior Member
:-( It seems I found another stupid mistake one can make in using
Epsilon. I used module.parse ("path_to_ETL_file") and then went on from
there. Debugging shows me that this seems to try and interpret
"path_to_ETL_file" as the actual ETL code instead of the name of the
file. Unfortunately, it didn't give me any error messages or exceptions
but just silently ignored any problems involved and left me with an
empty ETL module.

Cheers,

Steffen

Dimitrios Kolovos wrote:
> Hi Steffen,
>
> The only thing that comes to mind is that you don't store target when
> the transformation ends. Could you please add a few print statements
> after
>
> extEPackage.eSubpackages.addAll(coreSubpackages);
>
> to see the state of your model once the statements above have executed?
>
> e.g.
>
> extEPackage.eClassifiers.println();
>
> If the problem persists, could you please send me your transformation
> and involved models/metamodels so that I can investigate more?
>
> Cheers,
> Dimitrios
>
> Steffen Zschaler wrote:
>> Hi,
>>
>> It seems I'm still doing something wrong here. Here's the code I put
>> into pre:
>>
>> pre {
>> var coreEPackage := Core!EPackage.all.first();
>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>
>> -- Copy Core Metamodel
>> var extEPackage := new target!EPackage;
>> extPackage.name := 'Bla';
>> extEPackage.eClassifiers.addAll(coreClassifiers);
>> extEPackage.eSubpackages.addAll(coreSubpackages);
>> }
>>
>> However, all I get is an empty resulting model.
>>
>> Any ideas where the error could be?
>>
>> Steffen
>>
>> Dimitrios Kolovos wrote:
>>> Oh! I made the assumption that your source model would be Core.
>>> Since it is not, putting the code either in pre or post should be fine.
>>>
>>> Cheers,
>>> Dimitrios
>>>
>>> Steffen Zschaler wrote:
>>>> Hi,
>>>>
>>>> Thanks again. Not sure, I completely understand this. Why would
>>>> there be nothing to transform? The rules I am writing are not
>>>> actually transforming elements from Core, but rather are creating
>>>> additional elements based on information from a 'source' model. Am
>>>> I right in assuming that in this case I would be OK to do the copy
>>>> in pre?
>>>>
>>>> Cheers,
>>>>
>>>> Steffen
>>>>
>>>> Dimitrios Kolovos wrote:
>>>>> I'd do this in the post section instead so that it runs after the
>>>>> ETL rules. Otherwise the rules will have nothing to transform in
>>>>> the source model. (Just make sure you don't store Core after the
>>>>> transformation is done because by putting the classifiers and
>>>>> subpackages to ext you are actually removing them from core).
>>>>>
>>>>> Cheers,
>>>>> Dimitrios
>>>>>
>>>>> Steffen Zschaler wrote:
>>>>>> Hi Dimitrios,
>>>>>>
>>>>>> Thanks for the quick reply. I am actually generating ext. Would I
>>>>>> be able, then, to do this in the preamble of my ETL file, e.g.:
>>>>>>
>>>>>> pre {
>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>
>>>>>> var extEPackage := new Ext!EPackage;
>>>>>> extPackage.name := 'Bla';
>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>> }
>>>>>> Cheers,
>>>>>>
>>>>>> Steffen
>>>>>>
>>>>>> Dimitrios Kolovos wrote:
>>>>>>> Hi Steffen,
>>>>>>>
>>>>>>> I think that the most efficient way in your case is to load the
>>>>>>> two metamodels in an EOL program, move the eClassifiers and
>>>>>>> eSubpackages of the core metamodel to the extension metamodel
>>>>>>> and then save the extension metamodel using a different name. E.g.
>>>>>>>
>>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>>> var extEPackage := Ext!EPackage.all.first();
>>>>>>>
>>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>>
>>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>>>
>>>>>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>>>>>
>>>>>>> (just make sure you un-tick the Save on disposal checkbox when
>>>>>>> specifying the models)
>>>>>>>
>>>>>>> I've attached an example project (+launch configuration) that
>>>>>>> does this on two minimal core and ext metamodels.
>>>>>>>
>>>>>>> Hope this helps,
>>>>>>> Dimitrios
>>>>>>>
>>>>>>> Steffen Zschaler wrote:
>>>>>>>> Hi again,
>>>>>>>>
>>>>>>>> I have a core ecore metamodel and want to generate an extension
>>>>>>>> metamodel for this. This essentially means that I need to add a
>>>>>>>> few subclasses for some abstract classes in the core metamodel.
>>>>>>>> As discussed in earlier mails, I have a few tools that have
>>>>>>>> problems with ecore metamodels referencing each other. Hence, I
>>>>>>>> cannot use linking between the metamodels. Instead, I am
>>>>>>>> planning to hack around this by including a copy of all classes
>>>>>>>> and relationships from the core metamodel in my generated
>>>>>>>> metamodel.
>>>>>>>>
>>>>>>>> What is the most efficient way of creating such a copy?
>>>>>>>>
>>>>>>>> Many thanks,
>>>>>>>>
>>>>>>>> Steffen
>>>>>>>>
>>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>>> Hi Steffen,
>>>>>>>>>
>>>>>>>>> There are more than one ways to do this in ETL, EOL. Could you
>>>>>>>>> please give me a bit more details as to what you are trying to
>>>>>>>>> do so that I can suggest the best solution?
>>>>>>>>>
>>>>>>>>> I'd be grateful if we could take the discussion over to the
>>>>>>>>> eclipse.epsilon newsgroup as it sounds as something
>>>>>>>>> potentially interesting to others too (and also the more
>>>>>>>>> activity in the newsgroup, the better for the project ;)
>>>>>>>>>
>>>>>>>>> Cheers,
>>>>>>>>> Dimitrios
>>>>>>>>>
>>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> Is there a possibility in ETL to create a copy of a source
>>>>>>>>>> model to be further expanded in the transformation?
>>>>>>>>>>
>>>>>>>>>> Many thanks,
>>>>>>>>>>
>>>>>>>>>> Steffen
>>>>>>
>>>>>> --
>>>>>> Dr. rer. nat. Steffen Zschaler
>>>>>> Senior Research Associate
>>>>>>
>>>>>> Lancaster University
>>>>>> Lancaster, United Kingdom
>>>>>>
>>>>>> Email szschaler@acm.org
>>>>>> WWW http://www.steffen-zschaler.de/
>>>>>>
>>>>>> --
>>>>>>
>>>>>> Consider submitting to QoSA 2009, the 5th International
>>>>>> Conference on
>>>>>> the Quality of Software-Architectures.
>>>>>> http://qosa.ipd.uka.de/
>>>>>>
>>>>>> Consider submitting to MiSE 2009, the 3rd International Workshop
>>>>>> on Models in Software Engineering
>>>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>>>
>>
>> --
>> Dr. rer. nat. Steffen Zschaler
>> Senior Research Associate
>>
>> Lancaster University
>> Lancaster, United Kingdom
>>
>> Email szschaler@acm.org
>> WWW http://www.steffen-zschaler.de/
>>
>> --
>>
>> Consider submitting to QoSA 2009, the 5th International Conference on
>> the Quality of Software-Architectures.
>> http://qosa.ipd.uka.de/
>>
>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>> Models in Software Engineering
>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>

--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
WWW http://www.steffen-zschaler.de/

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09
Re: Copying models in ETL [message #561948 is a reply to message #3611] Wed, 12 November 2008 13:45 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Steffen,

The parse methods (located in AbstractModule) return a boolean
indicating if parsing has succeeded/failed (in your case it should
return false). If you think raising an exception instead would be a
better approach could you please add a new bug/enhancement request? (you
can use the following direct link - also available in the Epsilon
homepage -
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=GMT& component=Epsilon)

Cheers,
Dimitrios

Steffen Zschaler wrote:
> :-( It seems I found another stupid mistake one can make in using
> Epsilon. I used module.parse ("path_to_ETL_file") and then went on from
> there. Debugging shows me that this seems to try and interpret
> "path_to_ETL_file" as the actual ETL code instead of the name of the
> file. Unfortunately, it didn't give me any error messages or exceptions
> but just silently ignored any problems involved and left me with an
> empty ETL module.
>
> Cheers,
>
> Steffen
>
> Dimitrios Kolovos wrote:
>> Hi Steffen,
>>
>> The only thing that comes to mind is that you don't store target when
>> the transformation ends. Could you please add a few print statements
>> after
>>
>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>
>> to see the state of your model once the statements above have executed?
>>
>> e.g.
>>
>> extEPackage.eClassifiers.println();
>>
>> If the problem persists, could you please send me your transformation
>> and involved models/metamodels so that I can investigate more?
>>
>> Cheers,
>> Dimitrios
>>
>> Steffen Zschaler wrote:
>>> Hi,
>>>
>>> It seems I'm still doing something wrong here. Here's the code I put
>>> into pre:
>>>
>>> pre {
>>> var coreEPackage := Core!EPackage.all.first();
>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>
>>> -- Copy Core Metamodel
>>> var extEPackage := new target!EPackage;
>>> extPackage.name := 'Bla';
>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>> }
>>> However, all I get is an empty resulting model.
>>>
>>> Any ideas where the error could be?
>>>
>>> Steffen
>>>
>>> Dimitrios Kolovos wrote:
>>>> Oh! I made the assumption that your source model would be Core.
>>>> Since it is not, putting the code either in pre or post should be fine.
>>>>
>>>> Cheers,
>>>> Dimitrios
>>>>
>>>> Steffen Zschaler wrote:
>>>>> Hi,
>>>>>
>>>>> Thanks again. Not sure, I completely understand this. Why would
>>>>> there be nothing to transform? The rules I am writing are not
>>>>> actually transforming elements from Core, but rather are creating
>>>>> additional elements based on information from a 'source' model. Am
>>>>> I right in assuming that in this case I would be OK to do the copy
>>>>> in pre?
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Steffen
>>>>>
>>>>> Dimitrios Kolovos wrote:
>>>>>> I'd do this in the post section instead so that it runs after the
>>>>>> ETL rules. Otherwise the rules will have nothing to transform in
>>>>>> the source model. (Just make sure you don't store Core after the
>>>>>> transformation is done because by putting the classifiers and
>>>>>> subpackages to ext you are actually removing them from core).
>>>>>>
>>>>>> Cheers,
>>>>>> Dimitrios
>>>>>>
>>>>>> Steffen Zschaler wrote:
>>>>>>> Hi Dimitrios,
>>>>>>>
>>>>>>> Thanks for the quick reply. I am actually generating ext. Would I
>>>>>>> be able, then, to do this in the preamble of my ETL file, e.g.:
>>>>>>>
>>>>>>> pre {
>>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>>
>>>>>>> var extEPackage := new Ext!EPackage;
>>>>>>> extPackage.name := 'Bla';
>>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>>> }
>>>>>>> Cheers,
>>>>>>>
>>>>>>> Steffen
>>>>>>>
>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>> Hi Steffen,
>>>>>>>>
>>>>>>>> I think that the most efficient way in your case is to load the
>>>>>>>> two metamodels in an EOL program, move the eClassifiers and
>>>>>>>> eSubpackages of the core metamodel to the extension metamodel
>>>>>>>> and then save the extension metamodel using a different name. E.g.
>>>>>>>>
>>>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>>>> var extEPackage := Ext!EPackage.all.first();
>>>>>>>>
>>>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>>>
>>>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>>>>
>>>>>>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>>>>>>
>>>>>>>> (just make sure you un-tick the Save on disposal checkbox when
>>>>>>>> specifying the models)
>>>>>>>>
>>>>>>>> I've attached an example project (+launch configuration) that
>>>>>>>> does this on two minimal core and ext metamodels.
>>>>>>>>
>>>>>>>> Hope this helps,
>>>>>>>> Dimitrios
>>>>>>>>
>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>> Hi again,
>>>>>>>>>
>>>>>>>>> I have a core ecore metamodel and want to generate an extension
>>>>>>>>> metamodel for this. This essentially means that I need to add a
>>>>>>>>> few subclasses for some abstract classes in the core metamodel.
>>>>>>>>> As discussed in earlier mails, I have a few tools that have
>>>>>>>>> problems with ecore metamodels referencing each other. Hence, I
>>>>>>>>> cannot use linking between the metamodels. Instead, I am
>>>>>>>>> planning to hack around this by including a copy of all classes
>>>>>>>>> and relationships from the core metamodel in my generated
>>>>>>>>> metamodel.
>>>>>>>>>
>>>>>>>>> What is the most efficient way of creating such a copy?
>>>>>>>>>
>>>>>>>>> Many thanks,
>>>>>>>>>
>>>>>>>>> Steffen
>>>>>>>>>
>>>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>>>> Hi Steffen,
>>>>>>>>>>
>>>>>>>>>> There are more than one ways to do this in ETL, EOL. Could you
>>>>>>>>>> please give me a bit more details as to what you are trying to
>>>>>>>>>> do so that I can suggest the best solution?
>>>>>>>>>>
>>>>>>>>>> I'd be grateful if we could take the discussion over to the
>>>>>>>>>> eclipse.epsilon newsgroup as it sounds as something
>>>>>>>>>> potentially interesting to others too (and also the more
>>>>>>>>>> activity in the newsgroup, the better for the project ;)
>>>>>>>>>>
>>>>>>>>>> Cheers,
>>>>>>>>>> Dimitrios
>>>>>>>>>>
>>>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>>>> Hi,
>>>>>>>>>>>
>>>>>>>>>>> Is there a possibility in ETL to create a copy of a source
>>>>>>>>>>> model to be further expanded in the transformation?
>>>>>>>>>>>
>>>>>>>>>>> Many thanks,
>>>>>>>>>>>
>>>>>>>>>>> Steffen
>>>>>>>
>>>>>>> --
>>>>>>> Dr. rer. nat. Steffen Zschaler
>>>>>>> Senior Research Associate
>>>>>>>
>>>>>>> Lancaster University
>>>>>>> Lancaster, United Kingdom
>>>>>>>
>>>>>>> Email szschaler@acm.org
>>>>>>> WWW http://www.steffen-zschaler.de/
>>>>>>>
>>>>>>> --
>>>>>>>
>>>>>>> Consider submitting to QoSA 2009, the 5th International
>>>>>>> Conference on
>>>>>>> the Quality of Software-Architectures.
>>>>>>> http://qosa.ipd.uka.de/
>>>>>>>
>>>>>>> Consider submitting to MiSE 2009, the 3rd International Workshop
>>>>>>> on Models in Software Engineering
>>>>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>>>>
>>>
>>> --
>>> Dr. rer. nat. Steffen Zschaler
>>> Senior Research Associate
>>>
>>> Lancaster University
>>> Lancaster, United Kingdom
>>>
>>> Email szschaler@acm.org
>>> WWW http://www.steffen-zschaler.de/
>>>
>>> --
>>>
>>> Consider submitting to QoSA 2009, the 5th International Conference on
>>> the Quality of Software-Architectures.
>>> http://qosa.ipd.uka.de/
>>>
>>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>>> Models in Software Engineering
>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>>
>
Re: Copying models in ETL [message #561994 is a reply to message #3644] Wed, 12 November 2008 14:28 Go to previous message
Steffen Zschaler is currently offline Steffen ZschalerFriend
Messages: 266
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020902040106010302050708
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

I think there should be an exception instead. However, I'm not sure that
this is at the heart of things here. In particular, I was using the
following code to do the parsing:

module.parse ("path_to_ETL_file");
if (module.getParseProblems().size() > 0) {
System.err.println("Parse errors occured...");
for (ParseProblem problem : module.getParseProblems()) {
System.err.println(problem.toString());
}
throw new RuntimeException("Parse Problems.");
}


and no parse problems where indicated...

Steffen

Dimitrios Kolovos wrote:
> Hi Steffen,
>
> The parse methods (located in AbstractModule) return a boolean
> indicating if parsing has succeeded/failed (in your case it should
> return false). If you think raising an exception instead would be a
> better approach could you please add a new bug/enhancement request?
> (you can use the following direct link - also available in the Epsilon
> homepage -
> https://bugs.eclipse.org/bugs/enter_bug.cgi?product=GMT& component=Epsilon)
>
>
> Cheers,
> Dimitrios
>
> Steffen Zschaler wrote:
>> :-( It seems I found another stupid mistake one can make in using
>> Epsilon. I used module.parse ("path_to_ETL_file") and then went on
>> from there. Debugging shows me that this seems to try and interpret
>> "path_to_ETL_file" as the actual ETL code instead of the name of the
>> file. Unfortunately, it didn't give me any error messages or
>> exceptions but just silently ignored any problems involved and left
>> me with an empty ETL module.
>>
>> Cheers,
>>
>> Steffen
>>
>> Dimitrios Kolovos wrote:
>>> Hi Steffen,
>>>
>>> The only thing that comes to mind is that you don't store target
>>> when the transformation ends. Could you please add a few print
>>> statements after
>>>
>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>
>>> to see the state of your model once the statements above have executed?
>>>
>>> e.g.
>>>
>>> extEPackage.eClassifiers.println();
>>>
>>> If the problem persists, could you please send me your
>>> transformation and involved models/metamodels so that I can
>>> investigate more?
>>>
>>> Cheers,
>>> Dimitrios
>>>
>>> Steffen Zschaler wrote:
>>>> Hi,
>>>>
>>>> It seems I'm still doing something wrong here. Here's the code I
>>>> put into pre:
>>>>
>>>> pre {
>>>> var coreEPackage := Core!EPackage.all.first();
>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>
>>>> -- Copy Core Metamodel
>>>> var extEPackage := new target!EPackage;
>>>> extPackage.name := 'Bla';
>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>> }
>>>> However, all I get is an empty resulting model.
>>>>
>>>> Any ideas where the error could be?
>>>>
>>>> Steffen
>>>>
>>>> Dimitrios Kolovos wrote:
>>>>> Oh! I made the assumption that your source model would be Core.
>>>>> Since it is not, putting the code either in pre or post should be
>>>>> fine.
>>>>>
>>>>> Cheers,
>>>>> Dimitrios
>>>>>
>>>>> Steffen Zschaler wrote:
>>>>>> Hi,
>>>>>>
>>>>>> Thanks again. Not sure, I completely understand this. Why would
>>>>>> there be nothing to transform? The rules I am writing are not
>>>>>> actually transforming elements from Core, but rather are creating
>>>>>> additional elements based on information from a 'source' model.
>>>>>> Am I right in assuming that in this case I would be OK to do the
>>>>>> copy in pre?
>>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>> Steffen
>>>>>>
>>>>>> Dimitrios Kolovos wrote:
>>>>>>> I'd do this in the post section instead so that it runs after
>>>>>>> the ETL rules. Otherwise the rules will have nothing to
>>>>>>> transform in the source model. (Just make sure you don't store
>>>>>>> Core after the transformation is done because by putting the
>>>>>>> classifiers and subpackages to ext you are actually removing
>>>>>>> them from core).
>>>>>>>
>>>>>>> Cheers,
>>>>>>> Dimitrios
>>>>>>>
>>>>>>> Steffen Zschaler wrote:
>>>>>>>> Hi Dimitrios,
>>>>>>>>
>>>>>>>> Thanks for the quick reply. I am actually generating ext. Would
>>>>>>>> I be able, then, to do this in the preamble of my ETL file, e.g.:
>>>>>>>>
>>>>>>>> pre {
>>>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>>>
>>>>>>>> var extEPackage := new Ext!EPackage;
>>>>>>>> extPackage.name := 'Bla';
>>>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>>>> }
>>>>>>>> Cheers,
>>>>>>>>
>>>>>>>> Steffen
>>>>>>>>
>>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>>> Hi Steffen,
>>>>>>>>>
>>>>>>>>> I think that the most efficient way in your case is to load
>>>>>>>>> the two metamodels in an EOL program, move the eClassifiers
>>>>>>>>> and eSubpackages of the core metamodel to the extension
>>>>>>>>> metamodel and then save the extension metamodel using a
>>>>>>>>> different name. E.g.
>>>>>>>>>
>>>>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>>>>> var extEPackage := Ext!EPackage.all.first();
>>>>>>>>>
>>>>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>>>>
>>>>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>>>>>
>>>>>>>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>>>>>>>
>>>>>>>>> (just make sure you un-tick the Save on disposal checkbox when
>>>>>>>>> specifying the models)
>>>>>>>>>
>>>>>>>>> I've attached an example project (+launch configuration) that
>>>>>>>>> does this on two minimal core and ext metamodels.
>>>>>>>>>
>>>>>>>>> Hope this helps,
>>>>>>>>> Dimitrios
>>>>>>>>>
>>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>>> Hi again,
>>>>>>>>>>
>>>>>>>>>> I have a core ecore metamodel and want to generate an
>>>>>>>>>> extension metamodel for this. This essentially means that I
>>>>>>>>>> need to add a few subclasses for some abstract classes in the
>>>>>>>>>> core metamodel. As discussed in earlier mails, I have a few
>>>>>>>>>> tools that have problems with ecore metamodels referencing
>>>>>>>>>> each other. Hence, I cannot use linking between the
>>>>>>>>>> metamodels. Instead, I am planning to hack around this by
>>>>>>>>>> including a copy of all classes and relationships from the
>>>>>>>>>> core metamodel in my generated metamodel.
>>>>>>>>>>
>>>>>>>>>> What is the most efficient way of creating such a copy?
>>>>>>>>>>
>>>>>>>>>> Many thanks,
>>>>>>>>>>
>>>>>>>>>> Steffen
>>>>>>>>>>
>>>>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>>>>> Hi Steffen,
>>>>>>>>>>>
>>>>>>>>>>> There are more than one ways to do this in ETL, EOL. Could
>>>>>>>>>>> you please give me a bit more details as to what you are
>>>>>>>>>>> trying to do so that I can suggest the best solution?
>>>>>>>>>>>
>>>>>>>>>>> I'd be grateful if we could take the discussion over to the
>>>>>>>>>>> eclipse.epsilon newsgroup as it sounds as something
>>>>>>>>>>> potentially interesting to others too (and also the more
>>>>>>>>>>> activity in the newsgroup, the better for the project ;)
>>>>>>>>>>>
>>>>>>>>>>> Cheers,
>>>>>>>>>>> Dimitrios
>>>>>>>>>>>
>>>>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>>>>> Hi,
>>>>>>>>>>>>
>>>>>>>>>>>> Is there a possibility in ETL to create a copy of a source
>>>>>>>>>>>> model to be further expanded in the transformation?
>>>>>>>>>>>>
>>>>>>>>>>>> Many thanks,
>>>>>>>>>>>>
>>>>>>>>>>>> Steffen
>>>>>>>>
>>>>>>>> --
>>>>>>>> Dr. rer. nat. Steffen Zschaler
>>>>>>>> Senior Research Associate
>>>>>>>>
>>>>>>>> Lancaster University
>>>>>>>> Lancaster, United Kingdom
>>>>>>>>
>>>>>>>> Email szschaler@acm.org
>>>>>>>> WWW http://www.steffen-zschaler.de/
>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>>> Consider submitting to QoSA 2009, the 5th International
>>>>>>>> Conference on
>>>>>>>> the Quality of Software-Architectures.
>>>>>>>> http://qosa.ipd.uka.de/
>>>>>>>>
>>>>>>>> Consider submitting to MiSE 2009, the 3rd International
>>>>>>>> Workshop on Models in Software Engineering
>>>>>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>>>>>
>>>>
>>>> --
>>>> Dr. rer. nat. Steffen Zschaler
>>>> Senior Research Associate
>>>>
>>>> Lancaster University
>>>> Lancaster, United Kingdom
>>>>
>>>> Email szschaler@acm.org
>>>> WWW http://www.steffen-zschaler.de/
>>>>
>>>> --
>>>>
>>>> Consider submitting to QoSA 2009, the 5th International Conference on
>>>> the Quality of Software-Architectures.
>>>> http://qosa.ipd.uka.de/
>>>>
>>>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>>>> Models in Software Engineering
>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>>>
>>

--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email szschaler@acm.org
WWW http://www.steffen-zschaler.de/

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
http://qosa.ipd.uka.de/

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
http://wikiserver.sse.cs.tu-bs.de/mise09


--------------020902040106010302050708
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
I think there should be an exception instead. However, I'm not sure
that this is at the heart of things here. In particular, I was using
the following code to do the parsing:<br>
<blockquote>
<pre>module.parse ("path_to_ETL_file");
if (module.getParseProblems().size() &gt; 0) {
System.err.println("Parse errors occured...");
for (ParseProblem problem : module.getParseProblems()) {
System.err.println(problem.toString());
}
throw new RuntimeException("Parse Problems.");
}
</pre>
</blockquote>
and no parse problems where indicated...<br>
<br>
Steffen<br>
<br>
Dimitrios Kolovos wrote:
<blockquote cite="mid:gfemlr$kt2$4@build.eclipse.org" type="cite">Hi
Steffen,
<br>
<br>
The parse methods (located in AbstractModule) return a boolean
indicating if parsing has succeeded/failed (in your case it should
return false). If you think raising an exception instead would be a
better approach could you please add a new bug/enhancement request?
(you can use the following direct link - also available in the Epsilon
homepage -
<a class="moz-txt-link-freetext" href=" https://bugs.eclipse.org/bugs/enter_bug.cgi?product=GMT& component=Epsilon"> https://bugs.eclipse.org/bugs/enter_bug.cgi?product=GMT& amp;component=Epsilon</a>)
<br>
<br>
Cheers,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">:-( It seems I found another stupid mistake
one can make in using Epsilon. I used module.parse ("path_to_ETL_file")
and then went on from there. Debugging shows me that this seems to try
and interpret "path_to_ETL_file" as the actual ETL code instead of the
name of the file. Unfortunately, it didn't give me any error messages
or exceptions but just silently ignored any problems involved and left
me with an empty ETL module.
<br>
<br>
Cheers,
<br>
<br>
Steffen
<br>
<br>
Dimitrios Kolovos wrote:
<br>
<blockquote type="cite">Hi Steffen,
<br>
<br>
The only thing that comes to mind is that you don't store target when
the transformation ends. Could you please add a few print statements
after
<br>
<br>
extEPackage.eSubpackages.addAll(coreSubpackages);
<br>
<br>
to see the state of your model once the statements above have executed?
<br>
<br>
e.g.
<br>
<br>
extEPackage.eClassifiers.println();
<br>
<br>
If the problem persists, could you please send me your transformation
and involved models/metamodels so that I can investigate more?
<br>
<br>
Cheers,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
It seems I'm still doing something wrong here. Here's the code I put
into pre:
<br>
<br>
&nbsp;&nbsp;&nbsp; pre {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var coreEPackage := Core!EPackage.all.first();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var coreClassifiers := coreEPackage.eClassifiers.clone();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var coreSubpackages := coreEPackage.eSubpackages.clone();
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Copy Core Metamodel
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var extEPackage := new target!EPackage;
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extPackage.name := 'Bla';
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extEPackage.eClassifiers.addAll(coreClassifiers);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extEPackage.eSubpackages.addAll(coreSubpackages);
<br>
&nbsp;&nbsp;&nbsp; }
<br>
&nbsp;&nbsp;&nbsp;&nbsp; However, all I get is an empty resulting model.
<br>
<br>
Any ideas where the error could be?
<br>
<br>
Steffen
<br>
<br>
Dimitrios Kolovos wrote:
<br>
<blockquote type="cite">Oh! I made the assumption that your
source model would be Core. Since it is not, putting the code either in
pre or post should be fine.
<br>
<br>
Cheers,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
Thanks again. Not sure, I completely understand this. Why would there
be nothing to transform? The rules I am writing are not actually
transforming elements from Core, but rather are creating additional
elements based on information from a 'source' model. Am I right in
assuming that in this case I would be OK to do the copy in pre?
<br>
<br>
Cheers,
<br>
<br>
Steffen
<br>
<br>
Dimitrios Kolovos wrote:
<br>
<blockquote type="cite">I'd do this in the post section
instead so that it runs after the ETL rules. Otherwise the rules will
have nothing to transform in the source model. (Just make sure you
don't store Core after the transformation is done because by putting
the classifiers and subpackages to ext you are actually removing them
from core).
<br>
<br>
Cheers,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi Dimitrios,
<br>
<br>
Thanks for the quick reply. I am actually generating ext. Would I be
able, then, to do this in the preamble of my ETL file, e.g.:
<br>
<br>
&nbsp;&nbsp;&nbsp; pre {
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var coreEPackage := Core!EPackage.all.first();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var coreClassifiers := coreEPackage.eClassifiers.clone();
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var coreSubpackages := coreEPackage.eSubpackages.clone();
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var extEPackage := new Ext!EPackage;
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extPackage.name := 'Bla';
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extEPackage.eClassifiers.addAll(coreClassifiers);
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; extEPackage.eSubpackages.addAll(coreSubpackages);
<br>
&nbsp;&nbsp;&nbsp; }
<br>
&nbsp;&nbsp;&nbsp;&nbsp; Cheers,
<br>
<br>
Steffen
<br>
<br>
Dimitrios Kolovos wrote:
<br>
<blockquote type="cite">Hi Steffen,
<br>
<br>
I think that the most efficient way in your case is to load the two
metamodels in an EOL program, move the eClassifiers and eSubpackages of
the core metamodel to the extension metamodel and then save the
extension metamodel using a different name. E.g.
<br>
<br>
var coreEPackage := Core!EPackage.all.first();
<br>
var extEPackage := Ext!EPackage.all.first();
<br>
<br>
var coreClassifiers := coreEPackage.eClassifiers.clone();
<br>
var coreSubpackages := coreEPackage.eSubpackages.clone();
<br>
<br>
extEPackage.eClassifiers.addAll(coreClassifiers);
<br>
extEPackage.eSubpackages.addAll(coreSubpackages);
<br>
<br>
Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
<br>
<br>
(just make sure you un-tick the Save on disposal checkbox when
specifying the models)
<br>
<br>
I've attached an example project (+launch configuration) that does this
on two minimal core and ext metamodels.
<br>
<br>
Hope this helps,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi again,
<br>
<br>
I have a core ecore metamodel and want to generate an extension
metamodel for this. This essentially means that I need to add a few
subclasses for some abstract classes in the core metamodel. As
discussed in earlier mails, I have a few tools that have problems with
ecore metamodels referencing each other. Hence, I cannot use linking
between the metamodels. Instead, I am planning to hack around this by
including a copy of all classes and relationships from the core
metamodel in my generated metamodel.
<br>
<br>
What is the most efficient way of creating such a copy?
<br>
<br>
Many thanks,
<br>
<br>
Steffen
<br>
<br>
Dimitrios Kolovos wrote:
<br>
<blockquote type="cite">Hi Steffen,
<br>
<br>
There are more than one ways to do this in ETL, EOL. Could you please
give me a bit more details as to what you are trying to do so that I
can suggest the best solution?
<br>
<br>
I'd be grateful if we could take the discussion over to the
eclipse.epsilon newsgroup as it sounds as something potentially
interesting to others too (and also the more activity in the newsgroup,
the better for the project ;)
<br>
<br>
Cheers,
<br>
Dimitrios
<br>
<br>
Steffen Zschaler wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
Is there a possibility in ETL to create a copy of a source model to be
further expanded in the transformation?
<br>
<br>
Many thanks,
<br>
<br>
Steffen
<br>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<br>
--&nbsp;<br>
Dr. rer. nat. Steffen Zschaler
<br>
Senior Research Associate
<br>
<br>
Lancaster University
<br>
Lancaster, United Kingdom
<br>
<br>
Email <a class="moz-txt-link-abbreviated" href="mailto:szschaler@acm.org">szschaler@acm.org</a>
<br>
WWW&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="http://www.steffen-zschaler.de/">http://www..steffen-zschaler.de/</a>
<br>
<br>
--&nbsp;<br>
<br>
Consider submitting to QoSA 2009, the 5th International Conference on
<br>
the Quality of Software-Architectures.
<br>
<a class="moz-txt-link-freetext" href="http://qosa.ipd.uka.de/">http://qosa.ipd.uka.de/</a>
<br>
<br>
Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
<br>
<a class="moz-txt-link-freetext" href="http://wikiserver.sse.cs.tu-bs.de/mise09">http://wikiserver.sse.cs.tu-bs.de/mise09</a>
<br>
</blockquote>
</blockquote>
<br>
</blockquote>
</blockquote>
<br>
--&nbsp;<br>
Dr. rer. nat. Steffen Zschaler
<br>
Senior Research Associate
<br>
<br>
Lancaster University
<br>
Lancaster, United Kingdom
<br>
<br>
Email <a class="moz-txt-link-abbreviated" href="mailto:szschaler@acm.org">szschaler@acm.org</a>
<br>
WWW&nbsp;&nbsp; <a class="moz-txt-link-freetext" href="http://www.steffen-zschaler.de/">http://www.steffen-zschaler.de/</a>
<br>
<br>
--&nbsp;<br>
<br>
Consider submitting to QoSA 2009, the 5th International Conference on
<br>
the Quality of Software-Architectures.
<br>
<a class="moz-txt-link-freetext" href="http://qosa.ipd.uka.de/">http://qosa.ipd.uka.de/</a>
<br>
<br>
Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
<br>
<a class="moz-txt-link-freetext" href="http://wikiserver.sse.cs.tu-bs.de/mise09">http://wikiserver.sse.cs.tu-bs.de/mise09</a>
<br>
<br>
</blockquote>
</blockquote>
<br>
</blockquote>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Dr. rer. nat. Steffen Zschaler
Senior Research Associate

Lancaster University
Lancaster, United Kingdom

Email <a class="moz-txt-link-abbreviated" href="mailto:szschaler@acm.org">szschaler@acm.org</a>
WWW <a class="moz-txt-link-freetext" href="http://www.steffen-zschaler.de/">http://www.steffen-zschaler.de/</a>

--

Consider submitting to QoSA 2009, the 5th International Conference on
the Quality of Software-Architectures.
<a class="moz-txt-link-freetext" href="http://qosa.ipd.uka.de/">http://qosa.ipd.uka.de/</a>

Consider submitting to MiSE 2009, the 3rd International Workshop on
Models in Software Engineering
<a class="moz-txt-link-freetext" href="http://wikiserver.sse.cs.tu-bs.de/mise09">http://wikiserver.sse.cs.tu-bs.de/mise09</a></pre>
</body>
</html>

--------------020902040106010302050708--
Re: Copying models in ETL [message #562033 is a reply to message #3712] Wed, 12 November 2008 14:37 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Steffen,

With the current version you'd have to do something like:

boolean parseOK = module.parse(...);
if (!parseOK || module.getProblems().size() > 0) {
...
}

Thanks for submitting https://bugs.eclipse.org/bugs/show_bug.cgi?id=255046

Cheers,
Dimitrios

Steffen Zschaler wrote:
> Hi,
>
> I think there should be an exception instead. However, I'm not sure that
> this is at the heart of things here. In particular, I was using the
> following code to do the parsing:
>
> module.parse ("path_to_ETL_file");
> if (module.getParseProblems().size() > 0) {
> System.err.println("Parse errors occured...");
> for (ParseProblem problem : module.getParseProblems()) {
> System.err.println(problem.toString());
> }
> throw new RuntimeException("Parse Problems.");
> }
>
>
> and no parse problems where indicated...
>
> Steffen
>
> Dimitrios Kolovos wrote:
>> Hi Steffen,
>>
>> The parse methods (located in AbstractModule) return a boolean
>> indicating if parsing has succeeded/failed (in your case it should
>> return false). If you think raising an exception instead would be a
>> better approach could you please add a new bug/enhancement request?
>> (you can use the following direct link - also available in the Epsilon
>> homepage -
>> https://bugs.eclipse.org/bugs/enter_bug.cgi?product=GMT& component=Epsilon)
>>
>>
>> Cheers,
>> Dimitrios
>>
>> Steffen Zschaler wrote:
>>> :-( It seems I found another stupid mistake one can make in using
>>> Epsilon. I used module.parse ("path_to_ETL_file") and then went on
>>> from there. Debugging shows me that this seems to try and interpret
>>> "path_to_ETL_file" as the actual ETL code instead of the name of the
>>> file. Unfortunately, it didn't give me any error messages or
>>> exceptions but just silently ignored any problems involved and left
>>> me with an empty ETL module.
>>>
>>> Cheers,
>>>
>>> Steffen
>>>
>>> Dimitrios Kolovos wrote:
>>>> Hi Steffen,
>>>>
>>>> The only thing that comes to mind is that you don't store target
>>>> when the transformation ends. Could you please add a few print
>>>> statements after
>>>>
>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>
>>>> to see the state of your model once the statements above have executed?
>>>>
>>>> e.g.
>>>>
>>>> extEPackage.eClassifiers.println();
>>>>
>>>> If the problem persists, could you please send me your
>>>> transformation and involved models/metamodels so that I can
>>>> investigate more?
>>>>
>>>> Cheers,
>>>> Dimitrios
>>>>
>>>> Steffen Zschaler wrote:
>>>>> Hi,
>>>>>
>>>>> It seems I'm still doing something wrong here. Here's the code I
>>>>> put into pre:
>>>>>
>>>>> pre {
>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>
>>>>> -- Copy Core Metamodel
>>>>> var extEPackage := new target!EPackage;
>>>>> extPackage.name := 'Bla';
>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>> }
>>>>> However, all I get is an empty resulting model.
>>>>>
>>>>> Any ideas where the error could be?
>>>>>
>>>>> Steffen
>>>>>
>>>>> Dimitrios Kolovos wrote:
>>>>>> Oh! I made the assumption that your source model would be Core.
>>>>>> Since it is not, putting the code either in pre or post should be
>>>>>> fine.
>>>>>>
>>>>>> Cheers,
>>>>>> Dimitrios
>>>>>>
>>>>>> Steffen Zschaler wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> Thanks again. Not sure, I completely understand this. Why would
>>>>>>> there be nothing to transform? The rules I am writing are not
>>>>>>> actually transforming elements from Core, but rather are creating
>>>>>>> additional elements based on information from a 'source' model.
>>>>>>> Am I right in assuming that in this case I would be OK to do the
>>>>>>> copy in pre?
>>>>>>>
>>>>>>> Cheers,
>>>>>>>
>>>>>>> Steffen
>>>>>>>
>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>> I'd do this in the post section instead so that it runs after
>>>>>>>> the ETL rules. Otherwise the rules will have nothing to
>>>>>>>> transform in the source model. (Just make sure you don't store
>>>>>>>> Core after the transformation is done because by putting the
>>>>>>>> classifiers and subpackages to ext you are actually removing
>>>>>>>> them from core).
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>> Dimitrios
>>>>>>>>
>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>> Hi Dimitrios,
>>>>>>>>>
>>>>>>>>> Thanks for the quick reply. I am actually generating ext. Would
>>>>>>>>> I be able, then, to do this in the preamble of my ETL file, e.g.:
>>>>>>>>>
>>>>>>>>> pre {
>>>>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>>>>
>>>>>>>>> var extEPackage := new Ext!EPackage;
>>>>>>>>> extPackage.name := 'Bla';
>>>>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>>>>> }
>>>>>>>>> Cheers,
>>>>>>>>>
>>>>>>>>> Steffen
>>>>>>>>>
>>>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>>>> Hi Steffen,
>>>>>>>>>>
>>>>>>>>>> I think that the most efficient way in your case is to load
>>>>>>>>>> the two metamodels in an EOL program, move the eClassifiers
>>>>>>>>>> and eSubpackages of the core metamodel to the extension
>>>>>>>>>> metamodel and then save the extension metamodel using a
>>>>>>>>>> different name. E.g.
>>>>>>>>>>
>>>>>>>>>> var coreEPackage := Core!EPackage.all.first();
>>>>>>>>>> var extEPackage := Ext!EPackage.all.first();
>>>>>>>>>>
>>>>>>>>>> var coreClassifiers := coreEPackage.eClassifiers.clone();
>>>>>>>>>> var coreSubpackages := coreEPackage.eSubpackages.clone();
>>>>>>>>>>
>>>>>>>>>> extEPackage.eClassifiers.addAll(coreClassifiers);
>>>>>>>>>> extEPackage.eSubpackages.addAll(coreSubpackages);
>>>>>>>>>>
>>>>>>>>>> Ext.store(Ext.modelFile.replace('ecore', 'merged.ecore'));
>>>>>>>>>>
>>>>>>>>>> (just make sure you un-tick the Save on disposal checkbox when
>>>>>>>>>> specifying the models)
>>>>>>>>>>
>>>>>>>>>> I've attached an example project (+launch configuration) that
>>>>>>>>>> does this on two minimal core and ext metamodels.
>>>>>>>>>>
>>>>>>>>>> Hope this helps,
>>>>>>>>>> Dimitrios
>>>>>>>>>>
>>>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>>>> Hi again,
>>>>>>>>>>>
>>>>>>>>>>> I have a core ecore metamodel and want to generate an
>>>>>>>>>>> extension metamodel for this. This essentially means that I
>>>>>>>>>>> need to add a few subclasses for some abstract classes in the
>>>>>>>>>>> core metamodel. As discussed in earlier mails, I have a few
>>>>>>>>>>> tools that have problems with ecore metamodels referencing
>>>>>>>>>>> each other. Hence, I cannot use linking between the
>>>>>>>>>>> metamodels. Instead, I am planning to hack around this by
>>>>>>>>>>> including a copy of all classes and relationships from the
>>>>>>>>>>> core metamodel in my generated metamodel.
>>>>>>>>>>>
>>>>>>>>>>> What is the most efficient way of creating such a copy?
>>>>>>>>>>>
>>>>>>>>>>> Many thanks,
>>>>>>>>>>>
>>>>>>>>>>> Steffen
>>>>>>>>>>>
>>>>>>>>>>> Dimitrios Kolovos wrote:
>>>>>>>>>>>> Hi Steffen,
>>>>>>>>>>>>
>>>>>>>>>>>> There are more than one ways to do this in ETL, EOL. Could
>>>>>>>>>>>> you please give me a bit more details as to what you are
>>>>>>>>>>>> trying to do so that I can suggest the best solution?
>>>>>>>>>>>>
>>>>>>>>>>>> I'd be grateful if we could take the discussion over to the
>>>>>>>>>>>> eclipse.epsilon newsgroup as it sounds as something
>>>>>>>>>>>> potentially interesting to others too (and also the more
>>>>>>>>>>>> activity in the newsgroup, the better for the project ;)
>>>>>>>>>>>>
>>>>>>>>>>>> Cheers,
>>>>>>>>>>>> Dimitrios
>>>>>>>>>>>>
>>>>>>>>>>>> Steffen Zschaler wrote:
>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>
>>>>>>>>>>>>> Is there a possibility in ETL to create a copy of a source
>>>>>>>>>>>>> model to be further expanded in the transformation?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Many thanks,
>>>>>>>>>>>>>
>>>>>>>>>>>>> Steffen
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Dr. rer. nat. Steffen Zschaler
>>>>>>>>> Senior Research Associate
>>>>>>>>>
>>>>>>>>> Lancaster University
>>>>>>>>> Lancaster, United Kingdom
>>>>>>>>>
>>>>>>>>> Email szschaler@acm.org
>>>>>>>>> WWW http://www..steffen-zschaler.de/
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>>
>>>>>>>>> Consider submitting to QoSA 2009, the 5th International
>>>>>>>>> Conference on
>>>>>>>>> the Quality of Software-Architectures.
>>>>>>>>> http://qosa.ipd.uka.de/
>>>>>>>>>
>>>>>>>>> Consider submitting to MiSE 2009, the 3rd International
>>>>>>>>> Workshop on Models in Software Engineering
>>>>>>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>>>>>>
>>>>>
>>>>> --
>>>>> Dr. rer. nat. Steffen Zschaler
>>>>> Senior Research Associate
>>>>>
>>>>> Lancaster University
>>>>> Lancaster, United Kingdom
>>>>>
>>>>> Email szschaler@acm.org
>>>>> WWW http://www.steffen-zschaler.de/
>>>>>
>>>>> --
>>>>>
>>>>> Consider submitting to QoSA 2009, the 5th International Conference on
>>>>> the Quality of Software-Architectures.
>>>>> http://qosa.ipd.uka.de/
>>>>>
>>>>> Consider submitting to MiSE 2009, the 3rd International Workshop on
>>>>> Models in Software Engineering
>>>>> http://wikiserver.sse.cs.tu-bs.de/mise09
>>>>>
>>>
>
> --
> Dr. rer. nat. Steffen Zschaler
> Senior Research Associate
>
> Lancaster University
> Lancaster, United Kingdom
>
> Email szschaler@acm.org
> WWW http://www.steffen-zschaler.de/
>
> --
>
> Consider submitting to QoSA 2009, the 5th International Conference on
> the Quality of Software-Architectures.
> http://qosa.ipd.uka.de/
>
> Consider submitting to MiSE 2009, the 3rd International Workshop on
> Models in Software Engineering
> http://wikiserver.sse.cs.tu-bs.de/mise09
>
Previous Topic:InMemoryEmfModel without resource
Next Topic:(Beginner) Ant/Epsilon: "failed to create task or type epsilon.loadModel"
Goto Forum:
  


Current Time: Fri Apr 26 22:44:26 GMT 2024

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

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

Back to the top