Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » ATL:problem in tranformation
ATL:problem in tranformation [message #107375] Mon, 29 June 2009 10:51 Go to next message
venkatesh  is currently offline venkatesh Friend
Messages: 41
Registered: July 2009
Member
Hi ,

I am new to ATL transformation.i have


TypeA.ecore (metamodel) TypeB.ecore(MetaModel)

| |
| |
typeA.xmi(sourceModel) typeb.xmi(targetModel)




TypeA.ecore file look like this


<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage 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" xmi:id="EPackage1"
name="typeA" nsURI="platform:/resource/Port/Metamodel/TypeA.ecore"
nsPrefix="tpA">
<eClassifiers xsi:type="ecore:EClass" xmi:id="EClass2" name="testA">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="testAattr"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
</ecore:EPackage>


TypeB.ecore file look like this


<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage 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" xmi:id="EPackage1"
name="typeB" nsURI="platform:/resource/Port/Metamodel/TypeB.ecore"
nsPrefix="tpB">
<eClassifiers xsi:type="ecore:EClass" xmi:id="EClass2" name="testB">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="testBattr"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
</ecore:EPackage>



now i have create rule

-- @atlcompiler atl2006
module T_In2Out;
create typeBModel : typeB from typeAModel : typeA;

rule testA_2_testB2 {
from
v_left : typeA!testA
to
v_right : typeA!testB (
testBAttr <- v_left.testAattr
)
}


when i'm transforming it's giving the following error






SEVERE: ****** BEGIN Stack Trace
SEVERE: exception:
SEVERE: java.lang.ClassCastException@1ae3b4d
java.lang.IllegalArgumentException: java.lang.ClassCastException@1ae3b4d
at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.eclipse.m2m.atl.engine.vm.ClassNativeOperation.exec(Clas sNativeOperation.java:59)
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.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:759)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:608)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:899)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlu gin.java:1102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
SEVERE: A.main() : ??#22 null
SEVERE: local variables = {self=T_In2Out : ASMModule}
SEVERE: local stack = []
SEVERE: A.__matcher__() : ??#1 null
SEVERE: local variables = {self=T_In2Out : ASMModule}
SEVERE: local stack = []
SEVERE: A.__matchTestA_2_testB2() : ??#24 9:5-11:6
SEVERE: local variables = {v_left=typeAModel!<unnamed>, self=T_In2Out :
ASMModule}
SEVERE: local stack = [TransientLinkSet {}]
SEVERE: NativeOperation public static void
org.eclipse.m2m.atl.engine.vm.nativelib.ASMTransientLink.add TargetElement(org.eclipse.m2m.atl.engine.vm.StackFrame,org.e clipse.m2m.atl.engine.vm.nativelib.ASMTransientLink,org.ecli pse.m2m.atl.engine.vm.nativelib.ASMString,org.eclipse.m2m.at l.engine.vm.nativelib.ASMOclAny)
SEVERE: args = [TransientLink {rule = 'TestA_2_testB2', sourceElements =
{v_left = typeAModel!<unnamed>}, targetElements = {}, variables = {}},
TransientLink {rule = 'TestA_2_testB2', sourceElements = {v_left =
typeAModel!<unnamed>}, targetElements = {}, variables = {}}, 'v_right']
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.ClassNativeOperation.exec(Clas sNativeOperation.java:64)
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.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:759)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:608)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:899)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlu gin.java:1102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.IllegalArgumentException:
java.lang.ClassCastException@1ae3b4d
at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.eclipse.m2m.atl.engine.vm.ClassNativeOperation.exec(Clas sNativeOperation.java:59)
... 26 more




Thanks in Advance

venky
Re: ATL:problem in tranformation [message #107383 is a reply to message #107375] Mon, 29 June 2009 14:17 Go to previous messageGo to next message
Andy Carpenter is currently offline Andy CarpenterFriend
Messages: 145
Registered: July 2009
Senior Member
Venky,

I've not been through all of your code, but the target
of the transformation rule being typeA!testB looks
wrong; I would have expected it to be typeB!testB

Andy.

"venkatesh " <venkateshmvp@gmail.com> wrote in message
news:4d315c0d5518c4153356ca7ba3752f33$1@www.eclipse.org...
> Hi ,
>
> I am new to ATL transformation.i have
>
> TypeA.ecore (metamodel) TypeB.ecore(MetaModel)
>
> | |
> | |
> typeA.xmi(sourceModel) typeb.xmi(targetModel)
>
>
>
> TypeA.ecore file look like this
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage 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" xmi:id="EPackage1"
> name="typeA" nsURI="platform:/resource/Port/Metamodel/TypeA.ecore"
> nsPrefix="tpA">
> <eClassifiers xsi:type="ecore:EClass" xmi:id="EClass2" name="testA">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="testAattr"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> </eClassifiers>
> </ecore:EPackage>
>
>
> TypeB.ecore file look like this
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage 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" xmi:id="EPackage1"
> name="typeB" nsURI="platform:/resource/Port/Metamodel/TypeB.ecore"
> nsPrefix="tpB">
> <eClassifiers xsi:type="ecore:EClass" xmi:id="EClass2" name="testB">
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="testBattr"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> </eClassifiers>
> </ecore:EPackage>
>
>
>
> now i have create rule
> -- @atlcompiler atl2006
> module T_In2Out;
> create typeBModel : typeB from typeAModel : typeA;
>
> rule testA_2_testB2 {
> from
> v_left : typeA!testA
> to
> v_right : typeA!testB (
> testBAttr <- v_left.testAattr
> )
> }
>
>
> when i'm transforming it's giving the following error
>
>
>
>
>
>
> SEVERE: ****** BEGIN Stack Trace
> SEVERE: exception: SEVERE: java.lang.ClassCastException@1ae3b4d
> java.lang.IllegalArgumentException: java.lang.ClassCastException@1ae3b4d
> at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.eclipse.m2m.atl.engine.vm.ClassNativeOperation.exec(Clas sNativeOperation.java:59)
> 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.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:759)
> at
> org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:608)
> at
> org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:899)
> at
> org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlu gin.java:1102)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> SEVERE: A.main() : ??#22 null
> SEVERE: local variables = {self=T_In2Out : ASMModule}
> SEVERE: local stack = []
> SEVERE: A.__matcher__() : ??#1 null
> SEVERE: local variables = {self=T_In2Out : ASMModule}
> SEVERE: local stack = []
> SEVERE: A.__matchTestA_2_testB2() : ??#24 9:5-11:6
> SEVERE: local variables = {v_left=typeAModel!<unnamed>, self=T_In2Out :
> ASMModule}
> SEVERE: local stack = [TransientLinkSet {}]
> SEVERE: NativeOperation public static void
> org.eclipse.m2m.atl.engine.vm.nativelib.ASMTransientLink.add TargetElement(org.eclipse.m2m.atl.engine.vm.StackFrame,org.e clipse.m2m.atl.engine.vm.nativelib.ASMTransientLink,org.ecli pse.m2m.atl.engine.vm.nativelib.ASMString,org.eclipse.m2m.at l.engine.vm.nativelib.ASMOclAny)
> SEVERE: args = [TransientLink {rule = 'TestA_2_testB2', sourceElements =
> {v_left = typeAModel!<unnamed>}, targetElements = {}, variables = {}},
> TransientLink {rule = 'TestA_2_testB2', sourceElements = {v_left =
> typeAModel!<unnamed>}, targetElements = {}, variables = {}}, 'v_right']
> 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.ClassNativeOperation.exec(Clas sNativeOperation.java:64)
> 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.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:759)
> at
> org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:608)
> at
> org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:899)
> at
> org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlu gin.java:1102)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> Caused by: java.lang.IllegalArgumentException:
> java.lang.ClassCastException@1ae3b4d
> at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at
> org.eclipse.m2m.atl.engine.vm.ClassNativeOperation.exec(Clas sNativeOperation.java:59)
> ... 26 more
>
>
>
>
> Thanks in Advance
>
> venky
>
>
>
>
>
Re: ATL:problem in tranformation [message #107456 is a reply to message #107383] Tue, 30 June 2009 06:12 Go to previous message
venkatesh  is currently offline venkatesh Friend
Messages: 41
Registered: July 2009
Member
Hi Andy

It's working fine .I have done a small mistake.


Thanks
venky
Previous Topic:[QVT] refining mode
Next Topic:wsdl to uml
Goto Forum:
  


Current Time: Fri Apr 19 23:08:03 GMT 2024

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

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

Back to the top