Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » how to apply a stereotype to a dependency programmatically
how to apply a stereotype to a dependency programmatically [message #476852] Tue, 15 January 2008 16:43 Go to next message
Eclipse UserFriend
Originally posted by: adilanwar10.yahoo.fr

Hi all,
I m working on a UML profile called VUML, in this profile i need to apply a
stereotype called "viewExtension" to 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 .

i think that something is wrong in my profile definition
I attach the definition file
thanks for any solution
Adil



Re: how to apply a stereotype to a dependency programmatically [message #476855 is a reply to message #476852] Wed, 16 January 2008 16:52 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Adil,

After a quick look at your prifile, I cannot spot anything wrong with it.
What is the exception you are getting?

- James.


"Adil Anwar" <adilanwar10@yahoo.fr> wrote in message
news:fminsb$24d$1@build.eclipse.org...
> Hi all,
> I m working on a UML profile called VUML, in this profile i need to apply
> a stereotype called "viewExtension" to 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 .
>
> i think that something is wrong in my profile definition
> I attach the definition file
> thanks for any solution
> Adil
>
>
>
>
Re: how to apply a stereotype to a dependency programmatically [message #476856 is a reply to message #476855] Wed, 16 January 2008 17:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: adilanwar10.yahoo.fr

Hi James,
Thanks, i will to develop this transformation with ATL language
here a part of my ATL code

vext : UML2!Dependency(
client <-v,
supplier <-thisModule.resolveTemp(re.relation,'b')->asSequence().first()
)
do{
v.applyStereotype(thisModule.view);
vext.applyStereotype(thisModule.viewExtension);

I have got the exception below :

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)


Regards,
Adil
Re: how to apply a stereotype to a dependency programmatically [message #476860 is a reply to message #476856] Thu, 17 January 2008 13:40 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Adil

The code in that area looks like this...

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

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


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

}



Is it possible that the stereotype was already previously applied.?

- James.


"Adil Anwar" <adilanwar10@yahoo.fr> wrote in message
news:fmlevj$pnc$1@build.eclipse.org...
> Hi James,
> Thanks, i will to develop this transformation with ATL language
> here a part of my ATL code
>
> vext : UML2!Dependency(
> client <-v,
> supplier <-thisModule.resolveTemp(re.relation,'b')->asSequence().first()
> )
> do{
> v.applyStereotype(thisModule.view);
> vext.applyStereotype(thisModule.viewExtension);
>
> I have got the exception below :
>
> 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)
>
>
> Regards,
> Adil
>
Re: how to apply a stereotype to a dependency programmatically [message #476861 is a reply to message #476860] Fri, 18 January 2008 11:55 Go to previous message
Eclipse UserFriend
Originally posted by: adilanwar10.yahoo.fr

Hi James,
I don't think that, because with the instruction
vext : UML2!Dependency, i will create a new element,' Dependency' ,
without stereotype.
so it's not possible that the stereotype was previously applied,
perhaps the 'definition' variable is null
or getExtension(element, stereotype) returns null
in my profile, after creating the stereotype 'viewExtension' , i create an
extension with the metaclass Dependency, is that true ??
or i have missed somethings
thanks for your help
73.
Adil

"James Bruck" <jbruck@ca.ibm.com> a
Re: how to apply a stereotype to a dependency programmatically [message #625903 is a reply to message #476852] Wed, 16 January 2008 16:52 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Adil,

After a quick look at your prifile, I cannot spot anything wrong with it.
What is the exception you are getting?

- James.


"Adil Anwar" <adilanwar10@yahoo.fr> wrote in message
news:fminsb$24d$1@build.eclipse.org...
> Hi all,
> I m working on a UML profile called VUML, in this profile i need to apply
> a stereotype called "viewExtension" to 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 .
>
> i think that something is wrong in my profile definition
> I attach the definition file
> thanks for any solution
> Adil
>
>
>
>
Re: how to apply a stereotype to a dependency programmatically [message #625904 is a reply to message #476855] Wed, 16 January 2008 17:30 Go to previous message
Eclipse UserFriend
Originally posted by: adilanwar10.yahoo.fr

Hi James,
Thanks, i will to develop this transformation with ATL language
here a part of my ATL code

vext : UML2!Dependency(
client <-v,
supplier <-thisModule.resolveTemp(re.relation,'b')->asSequence().first()
)
do{
v.applyStereotype(thisModule.view);
vext.applyStereotype(thisModule.viewExtension);

I have got the exception below :

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)


Regards,
Adil
Re: how to apply a stereotype to a dependency programmatically [message #625908 is a reply to message #476856] Thu, 17 January 2008 13:40 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Adil

The code in that area looks like this...

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

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


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

}



Is it possible that the stereotype was already previously applied.?

- James.


"Adil Anwar" <adilanwar10@yahoo.fr> wrote in message
news:fmlevj$pnc$1@build.eclipse.org...
> Hi James,
> Thanks, i will to develop this transformation with ATL language
> here a part of my ATL code
>
> vext : UML2!Dependency(
> client <-v,
> supplier <-thisModule.resolveTemp(re.relation,'b')->asSequence().first()
> )
> do{
> v.applyStereotype(thisModule.view);
> vext.applyStereotype(thisModule.viewExtension);
>
> I have got the exception below :
>
> 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)
>
>
> Regards,
> Adil
>
Re: how to apply a stereotype to a dependency programmatically [message #625909 is a reply to message #476860] Fri, 18 January 2008 11:55 Go to previous message
Eclipse UserFriend
Originally posted by: adilanwar10.yahoo.fr

Hi James,
I don't think that, because with the instruction
vext : UML2!Dependency, i will create a new element,' Dependency' ,
without stereotype.
so it's not possible that the stereotype was previously applied,
perhaps the 'definition' variable is null
or getExtension(element, stereotype) returns null
in my profile, after creating the stereotype 'viewExtension' , i create an
extension with the metaclass Dependency, is that true ??
or i have missed somethings
thanks for your help
73.
Adil

"James Bruck" <jbruck@ca.ibm.com> a
Previous Topic:no metaclass for class diagram?
Next Topic:Help, please look at this issue
Goto Forum:
  


Current Time: Fri Mar 29 10:01:39 GMT 2024

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

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

Back to the top