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)?
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.
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.
- Assume you have in your model the following content:
- Create a new BIRT Report
- Create a new Data Source of type UML Model
- Create a new Data Set called Class Data Set using the Row Mapping, so that the Row Query Expression is
//Classand Row Query Type is
- Specify the Column Mapping, so that Name has one
classUrirecord, Query contains
classUri. TheType for both
- Create a new Data Set called Owned Attributes Data Set and a new parameter called class to the Query Parameters
- Use the Row Mapping, so that the Row Query Expression is
resolveURI($class)/attributeand Row Query type is
- Specify the Column Mapping, so that the Name, Query, and Type are
- Create a new Data Set called Inherited Attributes Data Set and a new parameter called class to the Query Parameters
- Use the Row Mapping, so that the Row Query Expression contains
resolveURI($class)/inheritedMemberand Row Query type contains
- Specify the Column Mapping, so that Name, Query, Type are
- Add a new Table with 2 columns and 2 details and on the report surface
- Bind the table to the data set Class Data Set
- Drag and drop the mapped column
classNamefor the Class Data set in the first Detail Row of the first column
- Add a new Table with 1 columns and 1 details in the first Detail Row of the class table second column
- Bind the table to the data set Owned Attributes Data Set
- Drag and drop in the Detail Row the mapped column
AttributeNameof the Owned Attributes Data set (delete the Header and Footer rows)
- Bind the Data Set Parameter to the
classUricolumn 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
row["classUri"], respectively, as in the following screenshots:
- 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
- Modify the table to look like the following screenshot:
- Save the template and run the report or use the preview. You will get the following result:
A template created with RSA 8.5.1 is attached to this document along with the sample model.
|Software Development||Rational Software Modeler||Reports||Windows, Linux||7.5, 7.5.1, 7.5.2, 7.5.3, 7.5.4, 7.5.5, 126.96.36.199, 188.8.131.52, 184.108.40.206, 220.127.116.11, 18.104.22.168|
|Software Development||Rational Software Architect for WebSphere Software||Reports||Linux, Windows||7.5, 7.5.1, 7.5.2, 7.5.3, 7.5.4, 7.5.5, 22.214.171.124, 126.96.36.199, 188.8.131.52, 184.108.40.206, 220.127.116.11, 8.0, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 18.104.22.168, 22.214.171.124, 8.5, 8.5.1|
|Software Development||Rational Software Architect Standard Edition||Linux, Windows||7.5, 7.5.1, 7.5.2, 7.5.3, 7.5.4, 7.5.5, 126.96.36.199, 188.8.131.52, 184.108.40.206, 220.127.116.11, 18.104.22.168|