Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Problem with UML2 profiles & ATL2.0.0
[ATL] Problem with UML2 profiles & ATL2.0.0 [message #71708] Fri, 11 January 2008 14:41 Go to next message
Eclipse UserFriend
Originally posted by: adilanwar10.yahoo.fr

Hi,
i need to apply some stereotypes to a UML2 model.
i used :
Eclipse : 3.3.0
EMF : 2.3.0
ATL : 2.0.0
UML2 : 2.1.0
module CorrespUML2VUML; -- Module Template

create OUT : UML2 from IN1 : UML2, IN2 : UML2, PRO : UML2, MC : MMC;

helper def : base : UML2!Stereotype = OclUndefined;

rule CreateVUML2Model{

from cp : MMC!CorrespondencePackage


to p : UML2!Model (

name <- 'ComposedModel'

)

do { p.applyProfile(UML2!Profile.allInstancesFrom('PRO')->select(p | p.name
= 'prof')->first());

thisModule.base <- UML2!Profile.allInstancesFrom('PRO')->select(p |
p.name='prof')

->first().ownedStereotype->select(s | s.name='base')->first();

}}

rule Similarity2Base{

from r : MMC!SimilarityRelationship

to b : UML2!Class(

name <- thisModule.getRefElement(r).name,

visibility <- thisModule.getRefElement(r).getElement.visibility,

isAbstract <- thisModule.getRefElement(r).getElement.isAbstract,

package <- r.cPackage

)

do{

b.applyStereotype(thisModule.base);

}}

when i launch the transformation i have the above execption

can anyone tell me what is the problem? how can i use stereotypes in my
transformation ??

Best regards,
Adil

GRAVE: ****** BEGIN Stack Trace

GRAVE: message: ERROR: exception during invocation of operation applyProfile
on UML2!Model (java method: public org.eclipse.emf.common.util.EList
org.eclipse.uml2.uml.internal.impl.PackageImpl.applyProfile( org.eclipse.uml2.uml.Profile))

GRAVE: exception:

GRAVE: org.eclipse.uml2.uml.internal.impl.ProfileImpl@e43c6f (name: prof,
visibility: <unset>) (visibility: public)

java.lang.IllegalArgumentException:
org.eclipse.uml2.uml.internal.impl.ProfileImpl@e43c6f (name: prof,
visibility: <unset>) (visibility: public)

at
org.eclipse.uml2.uml.internal.operations.PackageOperations.a pplyProfile(PackageOperations.java:524)

at
org.eclipse.uml2.uml.internal.impl.PackageImpl.applyProfile( PackageImpl.java:1051)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
Re: [ATL] Problem with UML2 profiles & ATL2.0.0 [message #71747 is a reply to message #71708] Fri, 11 January 2008 17:59 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050208050600090407010005
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hello,

Did you set the model handler to "UML2" instead of EMF ?

Regards,

William

Adil Anwar a
Re: [ATL] Problem with UML2 profiles & ATL2.0.0 [message #71766 is a reply to message #71747] Fri, 11 January 2008 18:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: adilanwar10.yahoo.fr

Thank you William
yes, i set the model handler to "UML2", but the problem was in my profile
definition.
now everything works fine

Best regards,
Adil

"William Piers" <william.piers@obeo.fr> a
Re: [ATL] Problem with UML2 profiles & ATL2.0.0 [message #71804 is a reply to message #71766] Sat, 12 January 2008 21:09 Go to previous message
Eclipse UserFriend
Originally posted by: adilanwar10.yahoo.fr

Hi all,
I have to apply a stereotype to a Dependency relationship
the classes members of this dependency are correctly stereotyped using the
applyStereotype operation, but when i do the same with the dependency
element i have an exception.

vext : UML2!Dependency(
client <-v,
supplier <-b
)
do{
v.applyStereotype(thisModule.view);
b.applyStereotype(thisModule.base);
vext.applyStereotype(thisModule.viewExtension);
}

how can i do this??
Best regards,
Adil

GRAVE: message: ERROR: exception during invocation of operation
applyStereotype on UML2!Dependency (java method: public
org.eclipse.emf.ecore.EObject
org.eclipse.uml2.uml.internal.impl.ElementImpl.applyStereoty pe(org.eclipse.uml2.uml.Stereotype))
GRAVE: exception:
GRAVE: org.eclipse.uml2.uml.internal.impl.StereotypeImpl@6a67ab (name:
viewExtension, visibility: <unset>) (isLeaf: false, visibility: public,
isAbstract: false) (isActive: false, isAbstract: false)
java.lang.IllegalArgumentException:
org.eclipse.uml2.uml.internal.impl.StereotypeImpl@6a67ab (name:
viewExtension, visibility: <unset>) (isLeaf: false, visibility: public,
isAbstract: false) (isActive: false, isAbstract: false)
at
org.eclipse.uml2.uml.internal.operations.ElementOperations.a pplyStereotype(ElementOperations.java:1410)
at
org.eclipse.uml2.uml.internal.impl.ElementImpl.applyStereoty pe(ElementImpl.java:501)







"Adil Anwar" <adilanwar10@yahoo.fr> a
Previous Topic:[ATL] [?bug?] getAppliedStereotype sometimes doesnt work
Next Topic:QVT Relations
Goto Forum:
  


Current Time: Tue Apr 23 17:44:44 GMT 2024

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

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

Back to the top