Digging out RRC custom attributes with RRDI

I seem to do a lot of “follow-up” posts: something I’m writing triggers something else and things start to multiply. Oh well…

This one is essentially the RRC version of  Digging out RTC custom attributes with RRDI (and Reporting on data with custom attributes).  As part of the workshop I needed to show a simple example of extracting and using a couple of attributes defined for an RRC requirement type. So I first assume that there are two attributes of type Integer named Cost and Multiplier defined for the Features in my RRC project.

I’ve modified a couple of Features to add values for these new attributes so I can get some meaningful data in RRDI.

The RRDI report I would like to generate should show these Features in a format similar to that in the graphic above, with an extra column that is the result of multiplying Cost by Multiplier.

Instead of starting with Query Studio as I did last time round, I’ll go straight to Report Studio and start with an empty List report.

The guts of the report lies in the following 5 queries/joins:

1. Requirements: Extracts the “Requirements ID” and “Name” columns from the Requirements query subject.






2. CostValues: Extracts the “Requirements ID”, “Extension Type Name” and “Value” columns from the Requirement Integer Extension query subject, with a Detail Filter [Extension Type Name]=’Cost’.

3. ReqsWithCost: A join on Requirements ID between the Requirements and CostValues queries, with the Requirements to CostValues cardinality set to 0..n (outer join). The outer join is important as without it the query will only show those requirements that have a value in the Cost attribute.





4. MultiplierValues: Extracts  the “Requirements ID”, “Extension Type Name” and “Value” columns from the Requirement Integer Extension query subject, with a Detail Filter [Extension Type Name]=’Multiplier’.

5. RequirementsCostMultipliers: A join on Requirements ID between the ReqWithCosts and MultiplierValues queries, with the Requirements to MultiplierValues cardinality set to 0..n (outer join). The outer join is important as without it the query will only show those requirements that have a value in the Multiplier attribute.






Once I’ve made sure I’ve added the Value attributes from both the Cost and Multiplier Extension query subjects to the final RequirementsCostMultipliers join, running the query should give a list of all requirements with values for Cost and Multiplier where available. I’ve sneaked in a Detail Filter on the Requirements query ([Requirement Type]=’Feature’) so only Features are shown.

Now that I have the correct data I add a calculated data item to RequirementsCostMultipliers that multiplies the Cost and Multiplier values.

Running the query shows the result of the calculation where available.

Now all that remains is to clean up the list on the report page to display the required results. I’ve also added a conditional style to the calculated column values to highlight null values and values above and  below a threshold in different colours.

Felt a little complicated but the only slightly complicated bit was working out how to put the queries together.

Digging out RTC custom attributes with RRDI

The canned data model in Rational Reporting for Development Intelligence (RRDI) pulls in most custom attributes added to Rational Team Concert, Rational Quality Manager or Rational Requirements Composer projects in the Operational Data Stores “Extension” query subjects. Here is an example documented in the CLM Infocenter that shows how to extract a custom attribute defined for a Test Case in Rational Quality Manager. While running the CLM 2011 reporting workshop I got asked to show how this can be applied to a custom attribute added to an RTC work item and a custom attribute added to an RRC requirement type. As the workshop is also an exploration of the tools RRDI provides report authors –  Query Studio and Report Studio – I showed two different ways of getting at these custom attributes, at the same time showing off how to use these two tools in concert (pun intended:-).

One easy way to get to those custom attributes in RTC work items is to start with Query Studio, setup a query that extracts the attributes of interest and then use the query in Report Studio to present it with bells and whistles if required. To begin I assume that my RTC “Defect” work item type has a custom string attribute with ID “com.ibm.team.apt.attribute.mystring“.

I’ve also created one or two sample Defects with some text in the custom attribute so I have something to show when creating reports:

I now launch the RRDI interface (aka “Cognos Connection”)from the RTC Reports menu on the web:

Then I start Query Studio from the Launch menu. I just want to create a simple list report that shows the values of the Id, Summary, Status and  “My String Attribute” attributes. First I insert the “Request ID“, “Name” and “Request Status” attributes of the Request query subject and sort by Request ID in descending order (not required, but sorting it this way lets me see my new work items at the top of the list) :



Next I navigate down to the “Request String Extension” query subject and insert the “Name” and “Value” attributes:

While we’re there, notice the other query subjects ending in “Extension”: there are subjects for most other custom attribute types, including Integer, Long and Large String. The CCM Data dictionary is a valuable resource that shows how custom attributes (and other attributes) are surfaced in RRDI.

Now that I have a simple list I open it in Report Studio for further editing and formatting.

First I’ll make a cosmetic edit and change the “Name2” column heading to “Custom Attribute Name“.

Now (the important bit) I need to filter out all custom attributes except my custom string attribute. Report Studio makes it a breeze to do this. Open the “Query” query for editing and drag the “Custom Attribute Name” data item to the “Detail Filters” pane to display the “Detail Filter Expression” dialog.

Next I place the cursor to the right of [Custom Attribute Name] and double-click the “=” operator (or you could just type it in:-) from the Functions tab.










Let’s say I haven’t the best short term  memory in the world and I’ve forgotten exactly how to spell the id of my custom attribute. Report Studio allows me to be forgetful: I just go to the Data Items tab in the expression editor, select “Custom Attribute Name” and click the “Select Value” icon to have Report Studio show all available custom attribute names and double-click “com.ibm.team.apt.attribute.mystring” to add it to the filter expression which now reads “[Custom Attribute Name]=’com.ibm.team.apt.attribute.mystring'”.

I click OK to add the new expression to the Detail Filter, run the report and presto I have a  (yes, very simple) report that shows my custom attribute.

Obviously both Query Studio and Report Studio can do way more than what I’ve shown here but the object of this exercise was to show one way of getting to custom attributes in RTC.

Next up: a slightly more complex example showing how to dig custom attributes out of RRC.