Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL]Problem with transformation of a model that contains XMI href attribute
[ATL]Problem with transformation of a model that contains XMI href attribute [message #57745] Tue, 14 August 2007 09:32 Go to next message
Eclipse UserFriend
Originally posted by: ancutagh.gmail.com

Hi,

I have an old metamodel (Old.ecore) and a new one (New.ecore).

I have two model files (OldM.xmi and Car.xmi) . The first one contains a
reference to the second one. I want to transform the Old.xmi to New.xmi
and keep the reference to Car.xmi. When I run the transformation,
I get the following exception:

------------ Exception message---------------
SEVERE: ****** BEGIN Stack Trace

SEVERE: exception:

SEVERE: The value of type 'class
org.eclipse.emf.ecore.impl.DynamicEObjectImpl' must be of type
'org.eclipse.emf.ecore.impl.EClassImpl@10cb191 (name: Car)
(instanceClassName: null) (abstract: false, interface: false)'

java.lang.ClassCastException: The value of type 'class
org.eclipse.emf.ecore.impl.DynamicEObjectImpl' must be of type
'org.eclipse.emf.ecore.impl.EClassImpl@10cb191 (name: Car)
(instanceClassName: null) (abstract: false, interface: false)'

at
org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$InternalSe ttingDelegateSingleEObject.dynamicGet(EStructuralFeatureImpl .java:2255)
at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:610)
at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:595)
at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:587)
at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:582)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.get(A SMEMFModelElement.java:134)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:288)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:133)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:91)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:325)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:133)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:91)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:289)

at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:155)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:105)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:81)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:351)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:453)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.launch(AtlReg ularVM.java:425)
at
org.eclipse.m2m.atl.adt.launching.AtlLaunchConfigurationDele gate.launch(AtlLaunchConfigurationDelegate.java:35)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:639)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:565)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:754)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlu gin.java:944)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
SEVERE: A.main() : ??#24 null

SEVERE: local variables = {self=Old2New : ASMModule}
SEVERE: local stack = []
SEVERE: A.__exec__() : ??#8 null
SEVERE: local variables = {self=Old2New : ASMModule, e=TransientLink {rule
= 'Old2New', sourceElements = {s = IN!Eu}, targetElements = {t =
OUT!<unnamed>}, variables = {}}}

SEVERE: local stack = []
SEVERE: A.__applyOld2New(1 : NTransientLink;) : ??#18 10:11-10:16
SEVERE: local variables = {t=OUT!<unnamed>, s=IN!Eu, self=Old2New :
ASMModule, link=TransientLink {rule = 'Old2New', sourceElements = {s =
IN!Eu}, targetElements = {t = OUT!<unnamed>}, variables = {}}}

SEVERE: local stack = [OUT!<unnamed>, OUT!<unnamed>, Old2New : ASMModule]

SEVERE: ****** END Stack Trace
INFO: Execution terminated due to error (see launch configuration to allow
continuation after errors).

SEVERE: null

java.lang.RuntimeException
at
org.eclipse.m2m.atl.engine.vm.SimpleDebugger.error(SimpleDeb ugger.java:185)
at
org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:85)
at
org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:77)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:163)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:133)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:91)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:325)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:133)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:91)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:230)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
at
org.eclipse.m2m.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:289)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:155)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:105)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:81)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:351)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:453)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.launch(AtlReg ularVM.java:425)at
org.eclipse.m2m.atl.adt.launching.AtlLaunchConfigurationDele gate.launch(AtlLaunchConfigurationDelegate.java:35)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:639)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:565)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:754)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(DebugUIPlu gin.java:944)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

Caused by: java.lang.ClassCastException: The value of type 'class
org.eclipse.emf.ecore.impl.DynamicEObjectImpl' must be of type
'org.eclipse.emf.ecore.impl.EClassImpl@10cb191 (name: Car)
(instanceClassName: null) (abstract: false, interface: false)'

at
org.eclipse.emf.ecore.impl.EStructuralFeatureImpl$InternalSe ttingDelegateSingleEObject.dynamicGet(EStructuralFeatureImpl .java:2255)
at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:610)
at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:595)
at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:587)
at
org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjec tImpl.java:582)at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.get(A SMEMFModelElement.java:134)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:288)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:161)
... 22 more
----------------------------------------
----------------------------------------

---------- Old.xmi -----------------
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="Old">
<Person name="Eu">
<Car xsi:type="Car" href="Car.xmi#Toyota"/>
</Person>
</xmi:XMI>
----------------------------------------
----------------------------------------

------------ Car.xmi ---------------
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="Old">
<Car xmi:id="Toyota" type="Toyota"/>
<Car xmi:id="Ford" type="Ford"/>
</xmi:XMI>
----------------------------------------
----------------------------------------

------------ Old.ecore ---------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
<ecore:EPackage name="Old">
<eClassifiers xsi:type="ecore:EClass" name="Person">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name"
ordered="false" unique="false" lowerBound="1" eType="/1/String"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="Car"
ordered="false" lowerBound="1" eType="/0/Car"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Car">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="type"
ordered="false" unique="false" lowerBound="1" eType="/1/String"/>
</eClassifiers>
</ecore:EPackage>
<ecore:EPackage name="PrimitiveTypes">
<eClassifiers xsi:type="ecore:EDataType" name="String"/>
</ecore:EPackage>
</xmi:XMI>
----------------------------------------
----------------------------------------

------------ New.ecore ---------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
<ecore:EPackage name="New">
<eClassifiers xsi:type="ecore:EClass" name="Person">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="fullName"
ordered="false" unique="false" lowerBound="1" eType="/1/String"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="Car"
ordered="false" upperBound="-1" eType="/0/Car"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Car">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="type"
ordered="false" unique="false" lowerBound="1" eType="/1/String"/>
</eClassifiers>
</ecore:EPackage>
<ecore:EPackage name="PrimitiveTypes">
<eClassifiers xsi:type="ecore:EDataType" name="String"/>
</ecore:EPackage>
</xmi:XMI>
----------------------------------------
----------------------------------------

------------ Old2New.atl ---------------
module Old2New; -- Module Template
create OUT : New from IN : Old;

rule Old2New {
from
s:Old!Person
to
t:New!Person (
fullName <- s.name,
Car <- s.Car
)
}
----------------------------------------
----------------------------------------

Could you please help me?

Thanks,
Anca
Re: [ATL]Problem with transformation of a model that contains XMI href attribute [message #57796 is a reply to message #57745] Tue, 14 August 2007 11:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: quentin.glineur.obeo.fr

This is a multi-part message in MIME format.
--------------020907030904060306050708
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

Hi,

The problem is that the cars defined in Car.xmi are instances from the
object Car of Old.ecore which is different from Car of New.xmi. (type
problem)

To complete your transformation, you need to add a rule transforming
cars from Old.ecore to cars from New.ecore.

rule oldCar2newCar {
from oc : Old!Car
to nc : New!Car (
type <- oc.type
)
}

Regards,

Quentin GLINEUR

Anca Ghitescu a
Re: [ATL]Problem with transformation of a model that contains XMI href attribute [message #57819 is a reply to message #57796] Tue, 14 August 2007 12:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ancutagh.gmail.com

Hi,

When I run the first time the transformation, it works fine. When I try to
launch it the second time, it throws me the same exception. If I close
Eclipse and re-open it, then the first time it works.

My problem is that I have a more complex transformation, and when I apply
the rule for elements with references to another model file, it throws me
the same exception.

Could you please tell me if you get this exception?

Regards,
Anca Ghitescu
Re: [ATL]Problem with transformation of a model that contains XMI href attribute [message #57868 is a reply to message #57819] Tue, 14 August 2007 14:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: quentin.glineur.obeo.fr

This is a multi-part message in MIME format.
--------------060008050706000303080101
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

Hi,

No, I do not manage to get your exception...
concerning your issue:
when dealing with inter-referencing models, you have to make mention of
all of them in the transformation header:

create OUT : New from IN : Old, IN2 : Old;

Then, at launch config time, indicate that IN is Old.xmi and IN2 is Car.xmi.

This is working for me.

Regards,

Quentin

Anca Ghitescu a
Re: [ATL]Problem with transformation of a model that contains XMI href attribute [message #57915 is a reply to message #57868] Tue, 14 August 2007 19:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: anca.ghitescu.siemens.com

Hi,

Thank you for your response.

If I add 'Car.xmi' as a source model for my transformation, then due to
the rule 'oldCar2newCar', the elements of 'Car.xmi' will be copied to my
new model file 'New.xmi'. And I do not
want this to happen because I have to keep the external references to the
elements of the file 'Car.xmi'.

If I remove 'Car.xmi' from the source models, I get the same exception.

Unfortunately I still haven't found a solution for my problem and I am
blocked.

Regards,
Anca

On Tue, 14 Aug 2007 16:43:20 +0200, Quentin Glineur
<quentin.glineur@obeo.fr> wrote:

> Hi,
>
> No, I do not manage to get your exception...
> concerning your issue:
> when dealing with inter-referencing models, you have to make mention of
> all of them in the transformation header:
>
> create OUT : New from IN : Old, IN2 : Old;
>
> Then, at launch config time, indicate that IN is Old.xmi and IN2 is
> Car.xmi.
>
> This is working for me.
>
> Regards,
>
> Quentin
>
> Anca Ghitescu a écrit :
>> Hi,
>>
>> When I run the first time the transformation, it works fine. When I try
>> to launch it the second time, it throws me the same exception. If I
>> close Eclipse and re-open it, then the first time it works.
>>
>> My problem is that I have a more complex transformation, and when I
>> apply the rule for elements with references to another model file, it
>> throws me the same exception.
>>
>> Could you please tell me if you get this exception?
>>
>> Regards,
>> Anca Ghitescu
>>



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: [ATL]Problem with transformation of a model that contains XMI href attribute [message #57965 is a reply to message #57915] Thu, 16 August 2007 08:33 Go to previous message
Eclipse UserFriend
Originally posted by: quentin.glineur.obeo.fr

This is a multi-part message in MIME format.
--------------040007070006080102050700
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

Hi,

OK, if what you REALLY want is new.xmi to have references to car.xmi
(which, to me, breaks the conformance of new.xmi to new.ecore because
you assign Old!Car in place of New!Car)
then the transformation is:

module Old2New; -- Module Template
create OUT : New from IN : Old, IN2 : Old;

rule Old2New {
from s:Old!Person
to t:New!Person (
fullName <- s.name,
Car <- Sequence {s.Car}
)
}

(It works !)

Regards,

Quentin GLINEUR

Anca Ghitescu a
Previous Topic:Problems with model new elements ...
Next Topic:collection of objects in the from of a rule
Goto Forum:
  


Current Time: Thu Apr 25 09:54:24 GMT 2024

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

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

Back to the top