Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] problem with applystereotype
[ATL] problem with applystereotype [message #78327] Fri, 04 April 2008 15:22 Go to next message
Eclipse UserFriend
Originally posted by: adilanwar10.yahoo.fr

Hi all,
sorry if this problem has been posted previously,
I need 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.
the code is this :
vext : UML2!Dependency(
name <- 'dep1',
client <- c,
visibility <-#public,
supplier <-thisModule.resolveTemp(re.relation,'c')->asSequence().first()
)
do{
c.applyStereotype(thisModule.view);
-- vext.applyStereotype(thisModule.viewExtension);

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)
Re: [ATL] problem with applystereotype [message #78496 is a reply to message #78327] Wed, 09 April 2008 13:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: adilanwar10.yahoo.fr

still no idea
Thanks for any help

"Adil Anwar" <adilanwar10@yahoo.fr> a
Re: [ATL] problem with applystereotype [message #78544 is a reply to message #78496] Wed, 09 April 2008 15:04 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.
--------------090206020000070101000405
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hello,

Does your profile correctly sets an extension which allows Dependency to
be stereotyped with "vext" ?
You can also check if you are able to stereotype a Dependency using the
UML editor.

Regards,

William

Adil Anwar a
Re: [ATL] problem with applystereotype [message #78583 is a reply to message #78544] Wed, 09 April 2008 15:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: adilanwar10.yahoo.fr

Thanks William,
yes, i can apply statically the stereotype 'viewExtension' to a dependency
with an UML editor,
you find as attached file my profile defintion file;
now, i writed this code to check if the stereotype was applied :
if (not vext.getAppliedStereotypes().oclIsUndefined()){

vext.debug(vext.getAppliedStereotypes()->size().toString());


}

else {

vext.applyStereotype(thisModule.viewExtension);

}

the getAppliedStereotypes method returns always an empty collection (size 0)
is there another method to apply a stereotype or to add a stereotype to an
element, or to unapply a stereotype ??

Regards,
Adil


"William Piers" <william.piers@obeo.fr> a
Re: [ATL] problem with applystereotype [message #78598 is a reply to message #78583] Wed, 09 April 2008 16:19 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.
--------------040004090808040801020908
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Ok, so the problem comes from the way that you call the applyStereotype
method. As far as I know, there are no other way to apply a stereotype
(but I didn't try so much ;-) ).

The error you get in the stacktrace directly comes from the UML2 plugin.

Is the profile correctly applied on the model ?
In the launch configuration, did you set the model handler to "UML2" (if
you use the Regular VM).

William

Adil Anwar a
Re: [ATL] problem with applystereotype [message #78642 is a reply to message #78598] Thu, 10 April 2008 08:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: adilanwar10.yahoo.fr

Hi William,
yes, i can generate an UML2 model as target model where elements are
correctly stereotyped (exeption dependency relationships of course)
the code Java in the UML2 pluging looks like this :

if (definition == null || getExtension(element, stereotype) == null

|| element.getStereotypeApplication(stereotype) != null) {

throw new IllegalArgumentException(String.valueOf(stereotype));

}

Regards
Adil

"William Piers" <william.piers@obeo.fr> a
Re: [ATL] problem with applystereotype [message #78657 is a reply to message #78642] Thu, 10 April 2008 10:39 Go to previous message
urs zeidler is currently offline urs zeidlerFriend
Messages: 91
Registered: July 2009
Member
I encountered the same issue, the profile is correct, and is applied and
the uml2 model handler is not able to set values for the stereotypes. I
think the modelhandler does not refresh the profile, because this only
happens if the profile is recreated, and if you stop Eclipse and
restart, all worked well.
So it seem a caching issue, i haven't look in the code for details. But
when refining the profile a intern ECORE model is created, and i think
the modelhandler uses the old one, so it's totally correct to raise an
error because the stereotype is not part of the applied profile, which
is the new one.
Perhaps filling an bug report would be appropriated.


greetings, urs.
Previous Topic:[ATL] Generic language2language transformation
Next Topic:aggregation relationship?
Goto Forum:
  


Current Time: Thu Mar 28 14:37:18 GMT 2024

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

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

Back to the top