[ATL] problem with applystereotype [message #78327] |
Fri, 04 April 2008 15:22 |
Eclipse User |
|
|
|
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 #78583 is a reply to message #78544] |
Wed, 09 April 2008 15:57 |
Eclipse User |
|
|
|
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 #78642 is a reply to message #78598] |
Thu, 10 April 2008 08:34 |
Eclipse User |
|
|
|
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 |
urs zeidler 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.
|
|
|
Powered by
FUDForum. Page generated in 0.05185 seconds