Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Strange behaviour with getAppliedStereoTypes(), getAppliedStereoType
Strange behaviour with getAppliedStereoTypes(), getAppliedStereoType [message #628125] Wed, 16 December 2009 10:30 Go to next message
Stefan  is currently offline Stefan
Messages: 13
Registered: October 2009
Junior Member
Hi,

i am currently working on an M2M transformation for an UML Model. Starting with a Model with two profiles applied. I have the following problem. While iterating over all packages embedded in the model i am trying to get the applied profiles for each package. if i do this:

Stereotype st : pack.getAppliedStereotypes()

I get back all the applied Stereotypes and everything is fine. But then i try to get a single StereoType by name, i always get back null. Even if i do something like this

for (Stereotype st : pack.getAppliedStereotypes()){
String name = st.getName();
Stereotype stereo = pack.getAppliedStereotype(name);

I dont understand why, i get all the applied stereotypes, iterating over them getting the name of each and the try to get it by name and it returns null.

Any advice?

Stefan
Re: Strange behaviour with getAppliedStereoTypes(), getAppliedStereoType [message #628126 is a reply to message #628125] Wed, 16 December 2009 19:43 Go to previous messageGo to next message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi Stefan,

You mention that " in the model i am trying to get the applied profiles "
but your code is trying to get applied stereotypes.
Could the problem be that you are trying to get sterotypes when you mean
profiles or vice versa?

- James.

"Stefan" <schegi@uni-koblenz.de> wrote in message
news:hgacrk$10j$1@build.eclipse.org...
> Hi,
>
> i am currently working on an M2M transformation for an UML Model. Starting
> with a Model with two profiles applied. I have the following problem.
> While iterating over all packages embedded in the model i am trying to get
> the applied profiles for each package. if i do this:
> Stereotype st : pack.getAppliedStereotypes()
>
> I get back all the applied Stereotypes and everything is fine. But then i
> try to get a single StereoType by name, i always get back null. Even if i
> do something like this
>
> for (Stereotype st : pack.getAppliedStereotypes()){
> String name = st.getName();
> Stereotype stereo = pack.getAppliedStereotype(name);
>
> I dont understand why, i get all the applied stereotypes, iterating over
> them getting the name of each and the try to get it by name and it returns
> null.
>
> Any advice?
>
> Stefan
>
Re: Strange behaviour with getAppliedStereoTypes(), getAppliedStereoType [message #913426 is a reply to message #628125] Sat, 15 September 2012 16:11 Go to previous messageGo to next message
martin schwehla is currently offline martin schwehla
Messages: 7
Registered: June 2012
Junior Member
add a prefix :

example: Name: BusinessModel
FindByName Profile::BusinessModel

in my case
Re: Strange behaviour with getAppliedStereoTypes(), getAppliedStereoType [message #913444 is a reply to message #913426] Sat, 15 September 2012 17:16 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4098
Registered: July 2009
Senior Member
Hi

You will need to make your message much clearer if anyone is to
understand it.

Regards

Ed Willink

On 15/09/2012 17:11, martin schwehla wrote:
> add a prefix :
> example: Name: BusinessModel
> FindByName Profile::BusinessModel
>
> in my case
Previous Topic:Deleting elements efficiently
Next Topic:InterfaceRealization in XMI
Goto Forum:
  


Current Time: Sun Oct 26 01:57:17 GMT 2014

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

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