![]() |
Telelogic Rhapsody (steve huntington) | ![]() |
Topic Title: ReporterPLUS: Requirements Tracing Matrix Topic Summary: Created On: 21-Jul-2005 13:37 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|||||||
We want to produce a report that tabulates a grid of requirements against the (e.g.) use cases that answer those requirements. The individual cells of the table would be blank if there's no relationship between the requirements and use cases. Where there is a relationship, the cell would specify the nature of that relationship.
It's only possible to iterate through one model element type at a time, and then you have to iterate to model elements within that (either by class or association). Having difficulties therefore seeing how to fill the grid. Q-language might help, but the documentation on this is so terse and there are no good examples to follow (unless I've missed something?). Any ideas? ------------------------- ----------------------- Matthew Thomas Panasonic Manufacturing UK Ltd |
|||||||
![]() |
|||||||
![]() |
|||||||
I have tried using the Anchor mechanism like this
- in the "Features" view of a requirement, anchor to each use case that is part of the requirements answer - iterate over the requirements, sub-iterate over the "anchoredElements" |
|||||||
![]() |
|||||||
![]() |
|||||||
You can anchor a use case to a requirement (on the features tab). This gives you access to what is anchored while "current" is a requirement.
Try this fragment, "insert node" into an iteration over a package.
|
|||||||
![]() |
|||||||
![]() |
|||||||
Im having the same problem.I followed the above from Orjan.
I wish to either create a link to the anchored UCD or print the UCD itself below the Requirements. Currently I could only show the name of the anchored element. Any idea? |
|||||||
![]() |
|||||||
![]() |
|||||||
Have you tried the fragment in the zip?. What you do is iterate over the association anchoredElements, and then in node below the iteration insert
[LINK: text=(«$name»), bookmark=(«$GUID»)] |
|||||||
![]() |
|||||||
![]() |
|||||||
Hi Orjan!
Unfortunately, we can't access your fragment, because this is a moderated forum, and your attachment has not been approved yet. I've contacted I-Logix, and they are going to move this thread to the main Rhapsody forum. best regards Simon ------------------------- Simon Morrish simon.morrish@eu.panasonic.com http://panasonic.co.uk Panasonic ideas for life |
|||||||
![]() |
|||||||
![]() |
|||||||
I thought I ought to clarify what we (Matthew and I) are trying to achieve here. We want three forms of output in our report:
(A) List of (and links to) anchored Use Cases for each Requirement. (B) List of (and links to) anchored Requirements for each Use Case. (C) Requirements Map table. Let's look at each in turn: (A) List of (and links to) anchored Use Cases for each Requirement. This is easy to achieve. A Requirement element has an [anchorededElements] collection which can be iterated through and filtered to find all anchored Use Cases. (B) List of (and links to) anchored Requirements for each Use Case. This is not straightforward. A Use Case (or any Classifier) does not have a similar [anchoredElements] collection, so it's not possible to navigate to anchored Requirements from a Use Case. (Note: This ability does not exist in ReporterPLUS or the COM API, but anchors are visible in both directions within Rhapsody; see the the Relations tab.) So what to do? Well, perhaps we could, for each Use Case, iterate through ALL requirements and find any that have an anchor to the Use Case? In ReporterPLUS, it would ideally look like: Code: From class "Package"... Iteration type = Association/useCases Condition = none Sort = none ...iterate over association "useCases" From class "UseCase"... Heading = Requirements Anchors Iteration type = Class/Requirement Condition = there_exists x in this->[anchoredElements] => $GUID of x = $GUID of parent Sort = none ...iterate over instances of class "Requirement" Body = [LINK: text=(«$displayName»), bookmark=(«$GUID»)][CR] The key to this is the condition in the second-level iteration, which is identifying any Requirements that have an anchor back to the Use Case, where "parent" refers to the current Use Case from the first-level iteration. However, there is no such variable as "parent" available - there is no way to get the context of a higher level iteration from within a lower level iteration. In fact, I'm 99% sure it's impossible to achieve this in ReporterPLUS. Roll-on ReporterPLUSPLUS. Still, undeterred, we have a partial solution: Code: From class "Package"... Iteration type = Association/useCases Condition = none Sort = none ...iterate over association "useCases" List anchored Requirements Heading = Requirements anchors Body = «replace_all (`,[ ]*`, comma map {$displayName} over filter {there_exists x in [anchoredElements] => $GUID = $GUID of this} over sort {$displayName} over all "Requirement", "\r\n")»[CR] So what the heck does that Q language expression do? Let's break it down: 1. «all "Requirement"» gets all Requirement elements in the model 2. «sort {$displayName} over ...» sorts them by displayName 3. «filter {there_exists x in [anchoredElements] => $GUID = $GUID of this} over ...» filters through any that have a link back to "this" - the current Use Case in the iteration. 4. «map {$displayName} over ...» returns the displayName of each requirement as a collection of strings 5. «comma ...» concatenates the string collection into a single comma-delimited string 6. «replace_all (`,[ ]*`, ..., "\r\n")» replaces all the commas with carriage-return/newlines. From this we get a list of all the Requirements that are anchored to the Use Case, but no hyperlinks:- a partial solution. (C) Requirements Map table We also want a matrix cross-referencing which Requirements are anchored to which Use Cases, similar to the following: (see ReqMapIdeal.gif) A workable representation in ReporterPLUS would be something like: Code: From class "Package"... Body = [BEGIN TABLE][NEW COLUMN] Use Cases[CR]Requirements ...iterate over instances of class "UseCase" to output the column headings Body = [NEW COLUMN][LINK: text=(«$displayName»), bookmark=(«$GUID»)] From class "Package... ...iterate over instances of class "Requirement" to output each row Body = [NEW ROW][NEW COLUMN][LINK: text=(«$displayName»), bookmark=(«$GUID»)] From class "Requirement"... ...iterate over all instances of class "UseCase" to output each cell in the row Body = [NEW COLUMN]«if there_exists x in this->[anchoredElements] => $GUID of x = $GUID of parent then "." else ""» ... As for (B), this won't work, for two reasons: 1. A Use Case has no [anchoredElements] collection. (Actually, this can be easily resolved - in this case - by changing the last line above to the following: Body = [NEW COLUMN]«if there_exists x in parent->[anchoredElements] => $GUID of x = $GUID of this then "." else ""» 2. There is no such variable as "parent" available. (D'oh!) Still undeterred, we managed to use Q language to form another partial solution: Code: From class "Package"... Body = [BEGIN TABLE][NEW COLUMN] Use Cases[CR]Requirements ...iterate over instances of class "UseCase" to output the column headings Body = [NEW COLUMN][LINK: text=(«$displayName»), bookmark=(«$GUID»)] From class "Package... Body = [NEW ROW][NEW COLUMN]«replace_all (`,[ ]*`, comma map {$displayName} over sort {$displayName} over all "Requirement", "\r\n")» ...iterate over instances of class "UseCase" to output each column in a single cell Body = [NEW COLUMN]«replace_all (`,[ ]*`, comma map {if there_exists x in [anchoredElements] => $GUID = $GUID of this then "." else ""} over sort {$displayName} over all "Requirement", "\r\n")» The Q language expressions used here are similar to those used in (B) above, so I won't explain them! The table output looks like this: (see ReqMapSolution.gif) This partial solution outputs all the content of each column into a single cell. This only works as long as none of the table content (eg requirement names) wraps onto two lines! I anticipate this approach could be extended to output the table as CSV for reading into Excel, which would avoid the line-wrapping problem. Conclusions We've been able to achieve a partial implementation of what we need. ReporterPLUS could have made the job much easier, and given us a full solution, with a couple of minor enhancements: 1. The ability to navigate anchors in both directions. 2. The ability to access the context of higher level iterations within sub-iterations. This has emerged as a severe limitation, and resolving it would greatly enhance usability and flexibility. In case it's useful to you, I've enclosed a ReporterPLUS template with the solutions I've described above. Any comments or improvements would be welcome!
------------------------- Simon Morrish simon.morrish@eu.panasonic.com http://panasonic.co.uk Panasonic ideas for life Edited: 28-Feb-2008 at 19:09 by Simon Morrish |
|||||||
![]() |
|||||||
![]() |
|||||||
I have a similar, though simpler requirement. I just want to produce a list of all anchored items associated with a requirement.
But I can't get Reporter+ to generate anything at all using an iterator over the anchoredElements association. I just get an empty cell in the table, or no text in the document (I've put in fixed text items above and below to check this.) I've also tried the fragment posted by Orjan (thanks) although this didn't work either (the iterator was the same as the one I was already trying.) If I browse the model-specific elements in the ReporterPlus browser I can see the anchoredElements item in blue for those requirements that have anchors to use cases. This isn't present for the requirements that aren't anchored. So I'm confident that there are anchors present in the model. I suppose I must be doing something wrong? (I'm probably not using the requirements objects correctly, because my <<specification>> attributes are empty, all my requirements description is in the <<description>> field. But I don't think this should affect the iterator, should it?) I guess this is going to be a tech support call, unless anyone has had this same problem and can quickly tell me what I've missed? |
|||||||
![]() |
|||||||
![]() |
|||||||
Ahah! Not withstanding the fact that I'm probably using this forum in a bad bad way, I have now discovered that my problems with iterators appears to be related to whether I select the entire model for the report, or just a package. When I report on all model elements I get the output I expect, when I report on a selected model elements (a package) the output is missing. A number of iterators appear to be affected, as other output I wasn't seeing earlier has also now appeared (yes - I did start with a supplied template and have been editing it - which is probably where I broke it.)
Anyway, I guess this is related to iterator context and is probably a 'feature'. I really want to have a single template and use it to generate one document per package in my model. I'm not sure how to achieve this, perhaps I will need to generate one document and split it by hand? If anyone can explain why reporting on selected model elements changes the iterator behaviour I'd appreciate the information. Thanks. |
|||||||
![]() |
|||||||
![]() |
|||||||
Hi Michael,
is the iteration type for the Requirements node of type 'Class' ? This means it iterates through all Requirements within the scope (what you've selected in Rhapsody browser tree or entire model). I suspect your template expects elements in a specific expected structure. It maybe looking for Requirements only at the first hierarchical level etc. I would check the iteration path (what-ever is displayed in the Iteration tab). Also, check the Conditions. There might be something preset. Otherwise, contact i-logix support and send a small test model and sample template. A. |
|||||||
![]() |
Telelogic Rhapsody
» Rhapsody Category » Rhapsody
»
ReporterPLUS: Requirements Tracing Matrix
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.