![]() |
Telelogic Rhapsody (steve huntington) | ![]() |
Topic Title: Q Sort Command Topic Summary: Created On: 14-Nov-2005 19:27 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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!
|
|
![]() |
Telelogic Rhapsody
» Rhapsody Category » Rhapsody
»
Q Sort Command
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.