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: Q Sort Command
Topic Summary:
Created On: 14-Nov-2005 19:27
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-Nov-2005 19:27
User is offline View Users Profile Print this message


Jessica Patla

Posts: 26
Joined: 2-Nov-2005

How do I sort the names of the owner using the sort command...in this expression?

sort{$name of model->[project]->[containedPackages]->[nestedPackages]->[nestedPackages]{$name="HTRWVCUBuildPkg"}->[nestedPackages]->[itsDependencies]{$name=$name of this}->[owner]}

Thanks
Report this to a Moderator Report this to a Moderator
 16-Nov-2005 09:43
User is offline View Users Profile Print this message


Simon Morrish

Posts: 127
Joined: 17-May-2005

Hi Jessica

The direct answer is this:


Code:
sort {$name}
over
model
->[project]
->[containedPackages]
->[nestedPackages]
->[nestedPackages]{$name="HTRWVCUBuildPkg"}
->[nestedPackages]
->[itsDependencies]{$name=$name of this}
->[owner]
...but there are a number of refinements possible. For instance, to avoid navigating into the dependency and back up to its owner, you could do:


Code:
sort {$name}
over
model
->[project]
->[containedPackages]
->[nestedPackages]
->[nestedPackages]{$name="HTRWVCUBuildPkg"}
->[nestedPackages]{
there_exists x in [itsDependencies]
=> $name of x=$name of this
}
... or to avoid the cumbersome navigation down through three levels of packages, you could do:

Code:
sort {$name}
over
filter {
($name of [owner] = "HTRWVCUBuildPkg")
and (
there_exists x in [itsDependencies]
=> $name of x = $name of this
)
}
over
all "Package"
...and it would be better to match on $GUID rather than $name, since dependencies can be named differently from the element they depend on:

Code:
sort {$name}
over
filter {
($name of [owner] = "HTRWVCUBuildPkg")
and (
there_exists x in [itsDependencies]->[dependsOn]
=> $GUID of x = $GUID of this
)
}
over
all "Package"
Finally, these expressions return a collection of objects. To display something in your report, you need to transform into a string. For instance:

Code:
comma
map {$name}
over
sort {$name}
over
filter {
($name of [owner] = "HTRWVCUBuildPkg")
and (
there_exists x in [itsDependencies]->[dependsOn]
=> $GUID of x = $GUID of this
)
}
over
all "Package"

Hope that helps!

regards,
Simon

-------------------------
Simon Morrish
simon.morrish@eu.panasonic.com
http://panasonic.co.uk
Panasonic ideas for life

Edited: 28-Feb-2008 at 19:00 by Simon Morrish
Report this to a Moderator Report this to a Moderator
 16-Nov-2005 13:39
User is offline View Users Profile Print this message


Jessica Patla

Posts: 26
Joined: 2-Nov-2005

Thank you Simon, I will try these out! How long have you been doing this...it is still very difficult for me and I feel this is all I have been doing for a month now!
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic Rhapsody forum.
There are currently 1 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.