Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] specify the UML2 metamodel
[ATL] specify the UML2 metamodel [message #78509] Wed, 09 April 2008 14:47 Go to next message
Rasha is currently offline RashaFriend
Messages: 61
Registered: July 2009
Member
Hi all,

I try to copy some classes from a profiled source model to the target
model according to the stereotype of the class and the value of its
property.

Both the source and target metamodels are UML2. The source model is a uml
file created by Papyrus.

When I run an ATL configuration, I specify the UML2 metamodel from the EMF
Registry button "uri:http://www.eclipse.org/uml2/2.1.0/UML" and I tried
both Model handler "UML2" and "EMF", but I got an empty target file.

When I tried these links
http://www.eclipse.org/uml2/2.1.0/UML
http://www.eclipse.org/uml2/2.0.0/UML
http://www.eclipse.org/uml2/1.0.0/UML
there was no files. This means that both the metamodels are not found.

Any help is highly appreciated,

Rasha
Re: [ATL] specify the UML2 metamodel [message #78530 is a reply to message #78509] Wed, 09 April 2008 14:56 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 297
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060509030105020407020807
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hello,

I don't think that the error comes from the UML uri. Do you have any
error in the console ?

William

Rasha a
Re: [ATL] specify the UML2 metamodel [message #78612 is a reply to message #78530] Wed, 09 April 2008 16:57 Go to previous messageGo to next message
Rasha is currently offline RashaFriend
Messages: 61
Registered: July 2009
Member
Thanks William for this quick reply. Yes I have this error in the console
----------
ATL Console initiated
SEVERE: ****** BEGIN Stack Trace
SEVERE: message: ERROR: could not find operation hasStereotype on
UML2!Class having supertypes: [UML2!BehavioredClassifier,
UML2!EncapsulatedClassifier, OclType, OclAny] (including Java operations)
SEVERE: A.main() : ??#17 null
SEVERE: local variables = {self=CopyClass : ASMModule}
SEVERE: local stack = []
SEVERE: A.__matcher__() : ??#6 null
SEVERE: local variables = {self=CopyClass : ASMModule}
SEVERE: local stack = []
SEVERE: A.__matchCopyclass() : ??#21 18:37-18:61
SEVERE: local variables = {null=IN!Employee, self=CopyClass : ASMModule}
SEVERE: local stack = []
SEVERE: MUML2!Class;.checkMyPropertyValue() : ??#2 6:13-6:47
SEVERE: local variables = {self=IN!Employee}
SEVERE: local stack = []
SEVERE: ****** END Stack Trace
INFO: Execution terminated due to error (see launch configuration to allow
continuation after errors).
SEVERE: ERROR: could not find operation hasStereotype on UML2!Class having
supertypes: [UML2!BehavioredClassifier, UML2!EncapsulatedClassifier,
OclType, OclAny] (including Java operations)
java.lang.RuntimeException: ERROR: could not find operation hasStereotype
on UML2!Class having supertypes: [UML2!BehavioredClassifier,
UML2!EncapsulatedClassifier, OclType, OclAny] (including Java operations)
at
org.eclipse.m2m.atl.engine.vm.SimpleDebugger.error(SimpleDeb ugger.java:195)
at
org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:95)
at
org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:91)
at
org.eclipse.m2m.atl.drivers.uml24atl.ASMUMLModelElement.real Invoke(ASMUMLModelElement.java:633)
at
org.eclipse.m2m.atl.drivers.uml24atl.ASMUMLModelElement.invo ke(ASMUMLModelElement.java:581)
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.drivers.uml24atl.ASMUMLModelElement.real Invoke(ASMUMLModelElement.java:616)
at
org.eclipse.m2m.atl.drivers.uml24atl.ASMUMLModelElement.invo ke(ASMUMLModelElement.java:581)
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.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:766)
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)
-------------

I’ve just applied the use case “Verifying UML profiled models” using the
same source files “sample.uml” and “sample.profile.uml”. I created the ATL
transformation file as shown on its web site with a little modification.

module CopyClass; -- Module Template
create OUT : UML2 from IN : UML2, IN_profile : UML2;

---This helper verifies if the value of the proterty 'myProperty' is
different of 'value1'
helper context UML2!Class def : checkMyPropertyValue() : Boolean =
if (self.hasStereotype('MyStereotype')) then
if (self.getTaggedValueFromStereotypeName('MyStereotype','myPro perty')
<> 'value1') then
true
else
false
endif
else
true
endif;

rule Copyclass{
from
s : UML2!Class (not s.checkMyPropertyValue())

to
t : UML2!Class(
name <- 'product' + s.name
)
}


Any hint to solve this problem will be great,

Rasha
Re: [ATL] specify the UML2 metamodel [message #78628 is a reply to message #78612] Thu, 10 April 2008 06:48 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 297
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060700030406090307060503
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hello,

This error indicates that you didn't define (or uncorrectly define) the
"hasStereotype" helper. UML2 doesn't natively provide that method, so
you must define it by your own, such as this :

helper context UML!"uml::Element" def: hasStereotype(stereotype :
String) : Boolean =
self.getAppliedStereotypes() -> collect(st | st.name) ->
includes(stereotype);

The usecase you took is embedded into Papyrus. If you simply copy the
code on this page :
http://www.eclipse.org/m2m/atl/usecases/Verifying_UML_profil ed_models/,
which seems to be only an extract, the hasStereotype method will be
missing. So the transformation will fail and your output model may be empty.

Best regards,

William

Rasha a
Re: [ATL] specify the UML2 metamodel [message #78671 is a reply to message #78628] Thu, 10 April 2008 19:01 Go to previous messageGo to next message
Rasha is currently offline RashaFriend
Messages: 61
Registered: July 2009
Member
Thanks William, this error was disappeared when I defined “hasStereotype”
helper. I defined also “getTaggedValueFromStereotypeName” helper which
returns the value of the property like that:

helper context UML!"uml::Element" def:
getTaggedValueFromStereotypeName(stereotype : String, propertyName :
String) : String =
self.getValue() -> collect(st | st.name) -> includes(propertyName);

But, It gives me
message: ERROR: could not find operation getValue on UML!Class having
supertypes: [UML!BehavioredClassifier, UML!EncapsulatedClassifier,
OclType, OclAny] (including Java operations)

Is there any another method to retrieve the value of the property than
getValue()?

I’m wondering if you could help me getting contact with Papyrus group. I
sent to them email through papyrus@cea.fr, but no one reply to me. All
what I need is the transformation and launch files for this use case.

Thanks again for your help,

Rasha
Re: [ATL] specify the UML2 metamodel [message #78701 is a reply to message #78671] Thu, 10 April 2008 20:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: narciso.martins.yahoo.com.br

Hi Hasha, could you post all source of your atl file?

I would like to help.

Best Regards,

Narciso Martins
Re: [ATL] specify the UML2 metamodel [message #78842 is a reply to message #78671] Fri, 11 April 2008 07:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: frederic_thomas_fr.yahoo.fr

Hi Rasha,

Rasha a écrit :
> Thanks William, this error was disappeared when I defined
> �hasStereotype� helper. I defined also
> �getTaggedValueFromStereotypeName� helper which returns the value of the
> property like that:
>
> helper context UML!"uml::Element" def:
> getTaggedValueFromStereotypeName(stereotype : String, propertyName :
> String) : String =
> self.getValue() -> collect(st | st.name) -> includes(propertyName);
>


I don't think that a java method "getValue" without any parameters
exists on the UML2 plugin.

For my transformation, this kind of helper works well :

helper context UML2!Element def : getTagValue(stereo :
UML2!Stereotype,tag : UML2!Property ) : UML2!Element =
self.getValue(self.getAppliedStereotype(stereo.name),tag.nam e);

Fred
Re: [ATL] specify the UML2 metamodel [message #78948 is a reply to message #78842] Fri, 11 April 2008 20:47 Go to previous message
Rasha is currently offline RashaFriend
Messages: 61
Registered: July 2009
Member
Thanks Fred. It works with me, but I got another error.

SEVERE: ERROR: get unsupported on OclAny.
java.lang.RuntimeException: ERROR: get unsupported on OclAny.
at
org.eclipse.m2m.atl.engine.vm.SimpleDebugger.error(SimpleDeb ugger.java:195)

I tried to find which plug-in I missed, but I couldn’t.
I got ATL for Eclipse 3.3.1.1.as plug-in using Eclipse Update Manager from
this site http://download.eclipse.org/modeling/m2m/updates/site-interi m.xml
And I have OCL 1.1 plug-in.

Any hint will be great,

Rasha
Previous Topic:[QVTO]Aggregation Relationship?
Next Topic:[Announcement] Eclipse/OMG Symposium at the OMG Technical Meeting in Ottawa
Goto Forum:
  


Current Time: Thu Dec 05 14:44:54 GMT 2019

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

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

Back to the top