IBM Support

How to build a BIRT template to report on classes with owned and inherited attributes

Question & Answer


Question

How do you build a BIRT template to report on all model classes with their owned attributes and their inherited ones using IBM Rational Software Architect (RSA)?

Cause

Retrieving all the model classes with their attributes and the ones that are inherited using BIRT can allow you to export to Microsoft Excel for further processing.

Answer

ANSWER

You can use the attribute and inheritedMember properties of classes.
Bellow are the step-by-step instruction on how you can achieve this result using RSA and BIRT.

  1. Assume you have in your model the following content:

  2. Create a new BIRT Report

  3. Create a new Data Source of type UML Model

  4. Create a new Data Set called Class Data Set using the Row Mapping, so that the Row Query Expression is //Class and Row Query Type is uml:Class

  5. Specify the Column Mapping, so that Name has one className and oneclassUri record, Query contains @name for className and getURI(.) for classUri. TheType for both className and classUri isString.

  6. Create a new Data Set called Owned Attributes Data Set and a new parameter called class to the Query Parameters

  7. Use the Row Mapping, so that the Row Query Expression is resolveURI($class)/attribute and Row Query type is uml:Property

  8. Specify the Column Mapping, so that the Name, Query, and Type are AttributeName, @name, String, respectively

  9. Create a new Data Set called Inherited Attributes Data Set and a new parameter called class to the Query Parameters

  10. Use the Row Mapping, so that the Row Query Expression contains resolveURI($class)/inheritedMember and Row Query type containsuml:Property

  11. Specify the Column Mapping, so that Name, Query, Type are inheritedAttributeName, @name, and String, respectively

  12. Add a new Table with 2 columns and 2 details and on the report surface

  13. Bind the table to the data set Class Data Set

  14. Drag and drop the mapped column className for the Class Data set in the first Detail Row of the first column




  15. Add a new Table with 1 columns and 1 details in the first Detail Row of the class table second column

  16. Bind the table to the data set Owned Attributes Data Set

  17. Drag and drop in the Detail Row the mapped column AttributeName of the Owned Attributes Data set (delete the Header and Footer rows)

  18. Bind the Data Set Parameter to the classUri column of the Class Data Set by selecting the table, going to the Properties Editor of the table, selecting the Binding tab, clicking on the Data Set Parameter Binding button to edit it, building the expression using the Class table classUri (row["classUri"]) available column binding, and verifying that the Parameter, Data Type, and Value are set to class, String, and row["classUri"], respectively, as in the following screenshots:











  19. Repeat step 15 to 18 with the Inherited Attributes Data Set and the InheritedAttributeNamemapped column using the second Detail Row of the class table second column

  20. Modify the table to look like the following screenshot:





  21. Save the template and run the report or use the preview. You will get the following result:



NOTE:
A template created with RSA 8.5.1 is attached to this document along with the sample model.

Related Information

[{"Product":{"code":"SSYK2S","label":"Rational Software Architect Designer"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Reports","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"8.0;8.0.1;8.0.2;8.0.3;8.0.4;8.0.4.1;8.0.4.2;8.5;8.5.1","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSCLKU","label":"Rational Software Modeler"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Reports","Platform":[{"code":"PF033","label":"Windows"},{"code":"PF016","label":"Linux"}],"Version":"7.5;7.5.1;7.5.2;7.5.3;7.5.4;7.5.5;7.5.5.1;7.5.5.2;7.5.5.3;7.5.5.4;7.5.5.5","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SS4JCV","label":"Rational Software Architect for WebSphere Software"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Reports","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"7.5;7.5.1;7.5.2;7.5.3;7.5.4;7.5.5;7.5.5.1;7.5.5.2;7.5.5.3;7.5.5.4;7.5.5.5;8.0;8.0.1;8.0.2;8.0.3;8.0.4;8.0.4.1;8.0.4.2;8.5;8.5.1","Edition":"","Line of Business":{"code":"LOB15","label":"Integration"}},{"Product":{"code":"SS4JE2","label":"Rational Software Architect Standard Edition"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":" ","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"7.5;7.5.1;7.5.2;7.5.3;7.5.4;7.5.5;7.5.5.1;7.5.5.2;7.5.5.3;7.5.5.4;7.5.5.5","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
10 September 2020

UID

swg21633762