Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » How do I use both AMW and UML2 modelHandlers?
How do I use both AMW and UML2 modelHandlers? [message #87067] Thu, 24 July 2008 12:06 Go to next message
Eclipse UserFriend
Originally posted by: sebastien.minguet.gmail.com

Hi everybody,

I am currently working on a transformation and I have a problem with the
modelHandlers

My Transfo takes 5 models as input
A UML2 model
B UML2 profile
C KDM model which previously served as a basis for creation of A
D TRACE model referencing transformation links between A and C
E IKDM model (woven model) containing various links between C elements

and as output a UML2 model O which is an enriched version of A

What I want to do is basically
- copy A in O
- browse E
for every link create a UML Dependency in O
for every element of C referenced by the link, find the matching
element in A using D and set it
as the client/supplier of the dependency
- Apply B on O, and apply stereotypes on the created dependencies

In my launcher modelHanlder are set like this
KDM -> EMF
TRACE -> AMW
WEAVING -> AMW

If I set UML2 with UML2 modelHandler I get an exception

GRAVE: ****** BEGIN Stack Trace
GRAVE: exception:
GRAVE: null
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor72.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:69)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:683)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:338)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:683)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:338)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
at
org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at
org.eclipse.m2m.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:299)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:169)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:111)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:87)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:326)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:426)
at
org.eclipse.m2m.atl.adt.launching.AtlRegularVM.launch(AtlReg ularVM.java:398)
at
org.eclipse.m2m.atl.adt.launching.AtlLaunchConfigurationDele gate.launch(AtlLaunchConfigurationDelegate.java:42)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:764)
at
org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:614)
at
org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:880)
at
org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlu gin.java:1083)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.ClassCastException:
org.eclipse.m2m.atl.drivers.uml24atl.ASMUMLModel cannot be cast to
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel
at
org.eclipse.gmt.weaver.amw4atl.ASMAMWModelElement.getWovenAS MModel(ASMAMWModelElement.java:116)
at
org.eclipse.gmt.weaver.amw4atl.ASMAMWModelElement.getReferre dElement(ASMAMWModelElement.java:192)
... 35 more

And If set UML2 modelHandler to EMF, it works fine as long as I don't use
applyProfile and appyStereotype
because I get a method not found exception. The problem is I need to use
them :)

Does anyone have an idea? I should probably divide transformation in 2 but
that would mean another copy of the UML model and using the trace model of
the first transformation.

Thanks in advance
Re: How do I use both AMW and UML2 modelHandlers? [message #87147 is a reply to message #87067] Fri, 25 July 2008 14:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Hugo.Bruneliere.univ-nantes.fr

Hi Sebastien,

Sebastien Minguet a écrit :
> Hi everybody,
>
> I am currently working on a transformation and I have a problem with the
> modelHandlers
>
> My Transfo takes 5 models as input
> A UML2 model
> B UML2 profile
> C KDM model which previously served as a basis for creation of A
> D TRACE model referencing transformation links between A and C
> E IKDM model (woven model) containing various links between C elements
>
> and as output a UML2 model O which is an enriched version of A
>
> What I want to do is basically
> - copy A in O
> - browse E for every link create a UML Dependency in O
> for every element of C referenced by the link, find the
> matching element in A using D and set it as the
> client/supplier of the dependency
> - Apply B on O, and apply stereotypes on the created dependencies
>
> In my launcher modelHanlder are set like this
> KDM -> EMF
> TRACE -> AMW
> WEAVING -> AMW
>
> If I set UML2 with UML2 modelHandler I get an exception
> GRAVE: ****** BEGIN Stack Trace
> GRAVE: exception: GRAVE: null
> java.lang.reflect.InvocationTargetException
> at sun.reflect.GeneratedMethodAccessor72.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:69)
>
> at
> org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
>
> at
> org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:683)
>
> at
> org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
> at
> org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:338)
> at
> org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
> at
> org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
>
> at
> org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:683)
>
> at
> org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
> at
> org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
> at
> org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
>
> at
> org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
>
> at
> org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
> at
> org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:338)
> at
> org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
> at
> org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
>
> at
> org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
>
> at
> org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
> at
> org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
> at
> org.eclipse.m2m.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:299)
>
> at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:169)
> at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:111)
> at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:87)
> at
> org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:326)
>
> at
> org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(AtlRegularVM.java:426)
>
> at
> org.eclipse.m2m.atl.adt.launching.AtlRegularVM.launch(AtlReg ularVM.java:398)
>
> at
> org.eclipse.m2m.atl.adt.launching.AtlLaunchConfigurationDele gate.launch(AtlLaunchConfigurationDelegate.java:42)
>
> at
> org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:764)
>
> at
> org.eclipse.debug.internal.core.LaunchConfiguration.launch(L aunchConfiguration.java:614)
>
> at
> org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(D ebugUIPlugin.java:880)
>
> at
> org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlu gin.java:1083)
> at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
> Caused by: java.lang.ClassCastException:
> org.eclipse.m2m.atl.drivers.uml24atl.ASMUMLModel cannot be cast to
> org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel
> at
> org.eclipse.gmt.weaver.amw4atl.ASMAMWModelElement.getWovenAS MModel(ASMAMWModelElement.java:116)
>
> at
> org.eclipse.gmt.weaver.amw4atl.ASMAMWModelElement.getReferre dElement(ASMAMWModelElement.java:192)
>
> ... 35 more
>
> And If set UML2 modelHandler to EMF, it works fine as long as I don't
> use applyProfile and appyStereotype
> because I get a method not found exception. The problem is I need to use
> them :)
>
> Does anyone have an idea? I should probably divide transformation in 2
> but that would mean another copy of the UML model and using the trace
> model of the first transformation.
>

The problem comes from the fact that the current version of the UML
model handler plugin doesn't properly extend the EMF model handler
plugin. It extends directly, like the EMF model handler plugin, the ASM
abstract model handler provided within ATL.

In order for the UML model handler plugin to be compatible with the AMW
model handler, it should be fully implemented by extension of the EMF
model handler plugin:
- The "AtlUML2ModelHandler" class should extend the
"AtlEMFModelHandler" class;
- The "ASMUMLModel" class should extend the "ASMEMFModel" class;
- The "ASMUMLModelElement" class should extend the
"ASMEMFModelElement" class.
It is realizable because most of the code coming from the UML model
handler plugin seems to have been copied from the EMF model handler plugin.

Does anyone intensively using UML2 already perform such an upgrade of
the UML model handler, or is ready to do so?

Best regards,

Hugo

> Thanks in advance
>

--
--------------------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod (INRIA & EMN)
University of Nantes
2, rue de la Houssiniere
44322 Nantes Cedex 3 - France
office +33 2 51 12 58 10 /\ cell.+33 6 07 42 45 30
EMail: hugo.bruneliere@inria.fr
http://www.sciences.univ-nantes.fr/lina/atl/
--------------------------------------------------------
Re: How do I use both AMW and UML2 modelHandlers? [message #87162 is a reply to message #87147] Mon, 28 July 2008 12:35 Go to previous message
Eclipse UserFriend
Originally posted by: sebastien.minguet.gmail.com

OK Thanks, at least I now know why it does not work. From what I've read
so far, UML2 model handler was created because profile application could
not be handled by EMF (http://wiki.eclipse.org/ATL_Model_Handlers). I
guess this means that there is no way to replace calls to function
applyProfile or applyStereotype by ATL UML2ModelHandler-independant code?
Previous Topic:[ATL] error transformation due to references to UML2
Next Topic:[ATL, XML] Transformation to xml: values between start- and end-tag
Goto Forum:
  


Current Time: Fri Sep 27 06:03:13 GMT 2024

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

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

Back to the top