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 |
Eclipse User |
|
|
|
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 #476856 is a reply to message #476855] |
Wed, 16 January 2008 17:30 |
Eclipse User |
|
|
|
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 |
james bruck 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 |
Eclipse User |
|
|
|
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 #625904 is a reply to message #476855] |
Wed, 16 January 2008 17:30 |
Eclipse User |
|
|
|
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 |
james bruck 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 |
Eclipse User |
|
|
|
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
|
|
|
Goto Forum:
Current Time: Thu Dec 26 18:37:51 GMT 2024
Powered by FUDForum. Page generated in 0.04099 seconds
|