It is currently Thu Feb 09, 2012 12:36 am

All times are UTC



Welcome
Welcome to RHAPSODY4YOU

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, respond to polls, upload and download content, and access many other special features. Registration is fast, simple, and absolutely free, so please, register to join our community today.





 Page 1 of 1 [ 5 posts ] 
Author Message
 Post subject: How to set stereotype for an attribute ?
PostPosted: Tue Nov 17, 2009 5:53 pm 

Joined: Tue Nov 17, 2009 5:47 pm
Posts: 3
I have defined different stereotype in my Rhapsody profile. I am creating classes programmatically using

Set newClass = tPack.addNewAggr(....) call.
Then I add attribute to it using
Set attrName = newClass.addAttribute(Name)

After creating this new attribute, I would like to set stereotype for this attibute as "input" where input is predefined stereotype in my profile. Which API call I should use ?


Sameer


Offline
 Profile  
 
 Post subject: Re: How to set stereotype for an attribute ?
PostPosted: Wed Nov 18, 2009 12:38 pm 

Joined: Mon Dec 08, 2008 12:52 pm
Posts: 17
Hi Sameer,

you can use attrName.setStereotype(input);

but before you can use this method, you have to find the stereotype object in your model. I use therefore an own method.

Regards
Jan


Offline
 Profile  
 
 Post subject: Re: How to set stereotype for an attribute ?
PostPosted: Fri Nov 20, 2009 6:17 pm 

Joined: Tue Nov 17, 2009 5:47 pm
Posts: 3
I cant find .setStereotype method. I am using Rhapsody 7.2. Which Rhapsody version it is available. I used .addStereotype method and it seems to be working.


Offline
 Profile  
 
 Post subject: Re: How to set stereotype for an attribute ?
PostPosted: Fri Nov 20, 2009 9:00 pm 

Joined: Tue Nov 17, 2009 5:47 pm
Posts: 3
Also one more question, how do you set type of attribute ?
when I try
Attributer.type.name = type
it says can not set property.

which call sets attribute type

Sameer


Offline
 Profile  
 
 Post subject: Re: How to set stereotype for an attribute ?
PostPosted: Mon Nov 23, 2009 2:43 pm 

Joined: Mon Dec 08, 2008 12:52 pm
Posts: 17
Hi Sameer,

in the Java API i would suggest the following orders to set the type of an attribute

IRPAttribute attribute;
attribute.setType(type);

where type is from the type IRPClassifier. So i think you have to first find the right classifier before you can set it.

Regards
Jan


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:


suspicion-preferred