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.
- 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
//Class
and Row Query Type isuml:Class
- Specify the Column Mapping, so that Name has one
className
and oneclassUri
record, Query contains@name
forclassName
andgetURI(.)
forclassUri
. TheType for bothclassName
andclassUri
isString
.
- 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)/attribute
and Row Query type isuml:Property
- Specify the Column Mapping, so that the Name, Query, and Type are
AttributeName
,@name
,String
, respectively
- 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)/inheritedMember
and Row Query type containsuml:Property
- Specify the Column Mapping, so that Name, Query, Type are
inheritedAttributeName
,@name
, andString
, respectively
- 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
className
for 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
AttributeName
of the Owned Attributes Data set (delete the Header and Footer rows)
- 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 tableclassUri (row["classUri"])
available column binding, and verifying that the Parameter, Data Type, and Value are set toclass
,String
, androw["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:
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"}}]
Was this topic helpful?
Document Information
Modified date:
10 September 2020
UID
swg21633762