Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic Rhapsody (steve huntington)
Decrease font size
Increase font size
Topic Title: Utility to capture .prp files
Topic Summary:
Created On: 14-Oct-2004 15:38
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 14-Oct-2004 15:38
User is offline View Users Profile Print this message


Edmund Mayer

Posts: 98
Joined: 30-Jun-2004

I want a way to CM my .prp files along with my Rhapsody projects. I know that I could use profiles as an alternative to .prp files, but there will still be some .prp files in use.

Has anyone already created a script/utility that somehow captures the .prp files used by a Rhapsody project?

Ed
Report this to a Moderator Report this to a Moderator
 14-Oct-2004 15:39
User is offline View Users Profile Print this message


Andy Lapping

Posts: 135
Joined: 30-Jun-2004

I wrote something that would capture any project level overriden properties and then output them to a new site/siteLang prp file
Report this to a Moderator Report this to a Moderator
 24-Aug-2005 16:13
User is offline View Users Profile Print this message


Michael Hasling

Posts: 7
Joined: 7-Jul-2005

I was also wondering whether it was possible to define a prp file that was associated with the model rather than the 'site'. I couldn't find anything in the documentation that suggests this is possible - perhaps in a future version of Rhapsody?

My need was to add custom properties to model elements that I could use to control extraction by Reporter+. I've seen other posts that use tags defined in a profile. Is there any preference for one or other approach? Are the tag and property concepts essentially similar, or are they intended for very different purposes?
Report this to a Moderator Report this to a Moderator
 30-Aug-2005 22:16
User is offline View Users Profile Print this message


Jeffrey Vocell

Posts: 2
Joined: 7-Feb-2006

How do you do that?
Report this to a Moderator Report this to a Moderator
 31-Aug-2005 07:53
User is offline View Users Profile Print this message


Michael Hasling

Posts: 7
Joined: 7-Jul-2005

Sorry, I didn't really understand the question 'How do you do that?'

If you mean 'How do I define properties for a model?' then I don't know - that was my question!

If you mean 'How do I control extraction by Reporter+?' then my current answer is I don't know, although when I posted this I was hoping to be able to sort by the values in the property. But it seems like the sort key can only be a simple element attribute, but I would like to use a Q language expression (in order to follow the association to the properties collection and extract the value for the custom property defined in the model!) So my question was posted in advance of actually trying my ideas.

Or perhaps your question was something else entirely - or directed to someone else's post?

I'm still no wiser regarding the difference between properties and tags. Is a tag just a property that can be defined per model by specifying it in a package?
Report this to a Moderator Report this to a Moderator
 31-Aug-2005 16:16
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

Hi, Michael

I already do what you're suggesting; I set properties in my model to control the sorting of model elements in the generated report.

The approach I've taken is to add a "SortOrder" property to all model elements by adding the following to my site.prp:

[CODE]Subject ReporterPLUS
Metaclass Package
Property SortOrder Int ""
end
Metaclass Class
Property SortOrder Int ""
end
Metaclass Actor
Property SortOrder Int ""
end
(and so on for all metaclasses!)
end[/CODE]

In my model, I set this property for all model elements which I want to sort in my reports. For instance, if I have a collection of classes, I set ReporterPLUS.Class.SortOrder for each class so that the class I want to appear first has the lowest number and the class I want to appear last has the higest number.

Then, in my ReporterPLUS template I iterate over the collection of classes, and set a sort key as follows:

[CODE] $value of [property] {$name = "ReporterPLUS.Class.SortOrder"}[/CODE]

I hope that helps, or at least increases your confidence that your approach will work!


Regarding your other points:

1. The difference between properties and tags.

Like you, I'm not too clear on the conceptual difference between them.

In practice, Tags can be added directly to a model element, or they can be applied via a stereotype. Properties appear on all elements of the metaclass they are defined for, regardless of stereotyping.

For the application discussed here, it may be less error-prone and lower-maintenance to use properties.

2. Setting properties for a particular project

I've not found a need to set add properties to a particular project, but it can be done. (See my next post.)

best regards,
Simon

-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life
Report this to a Moderator Report this to a Moderator
 31-Aug-2005 16:27
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

Hi Michael

You can add properties to a project using the VBA/COM API.

I've enclosed a VBA module containing an addProperty operation. You need to:

1. Save the attached AddProperty.bas.txt without the .txt extension!
2. Open Rhapsody, load project, select Tools\VBA\Visual Basic Editor from the menu.
3. In the VBA editor, choose File\Import from the menu, select AddProperty.bas and select Open.
4. Close the VBA editor.
5. Select the model element to which you want to add a property.
6. Choose Tools\VBA\Macros... from the menu (or press <Alt-F8>.
7. Run addProperty and follow the prompts.

The user interface is a bit crude (!), but if you enter an invalid property definition it will show you an error message with some valid examples and tips to help you.

regards,
Simon




-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life
Report this to a Moderator Report this to a Moderator
 31-Aug-2005 16:49
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

Ed

To address your original question:

I don't know of a way to discover the list of .prp files read in my Rhapsody via the COM API...

However, if you're concerned to ensure that later changes to property files don't affect your project, you could consider "fixing" all the property values in the project itself:

For this, you could try the RPApplication.getListOfFactoryProperties and RPApplication.getListOfSiteProperties functions in the COM API. (Perhaps only the latter is required, since the former are "guaranteed not to change".) You could iterate through the collection and override each property in your RPProject to its current value:

[CODE] Dim rpy As RPProject, prp As Variant
Set rpy = getProject

For Each prp In getListOfSiteProperties
Dim prpName
prpName = Split(prp, ":", 2)(0)
rpy.setPropertyValue prpName, rpy.getPropertyValue(prpName)
Next[/CODE]

This will result in ALL the properties at the top level of your project being overridden, impervious to changes in site properties, and CM'ed with your project.

An idea, anyway...

regards,
Simon

-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life
Report this to a Moderator Report this to a Moderator
 31-Aug-2005 16:59
User is offline View Users Profile Print this message


Michael Hasling

Posts: 7
Joined: 7-Jul-2005

Hi Simon,

Thanks for your comprehensive and helpful replies.

Regarding your 2nd post on properties - I don't fully appreciate the use of VBA and may have misunderstood your solution, but what I was thinking of was a xxx.prp file that was stored with the xxx.rpy file rather than in c:\rhapsody. The idea being that these properties would be available when working on this model, and by all engineers working on the model, and the property definitions are config-managed along with the model files.

This is particularly of interest in my organisation where we may work concurrently on a couple of projects (= models) which have different custom property settings.

I confess I haven't tried your VBA, so it may solve the issue. But your covering text left me thinking that it was a different problem being solved?
Report this to a Moderator Report this to a Moderator
 31-Aug-2005 17:26
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

Hi Michael

You got me! I'm not solving your problem head-on. I don't know of a way to achieve a .prp file per project, though you might look at the use of "Include" lines in your site.prp file. (See the Rhapsody documentation for help on this.)

What the VBA does is set properties directly in the project, bypassing the need for a .prp file. Once set, the properties will be available for all developers to edit, just like properties defined in a .prp file.

The only snag is that if such a property is "unoverridden" in the same model element it was added. (ie. not in a sub-element) then the property will disappear.

To mitigate this, I'd suggest adding all your properties (with default values) in the top-level project element, and have your developers override these default values (just like normal properties) within their packages, classes, etc.

all the best,
Simon

-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic Rhapsody forum.
There are currently 0 users logged in.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.