Question & Answer
Question
How can you show the operations constraints grouped by type (Pre-Condition, Body, Post-Condition) using BIRT in IBM Rational Software Architect?
Cause
The type of an operation constraint is shown in the user interface in a drop-down list with the possible values: Pre-Condition, Body, Post-Condition.
However, there is no Type attribute of the uml:Constraint
metaclass.
The uml:Operation
metaclass contains three lists called: precondition
, bodyCondition
, postcondition
.
Each of these lists contains the uniform resource identifiers of the constraints of given type.
Answer
SOLUTION
- Create a new BIRT Report
- Add a data source of type UML Model
- Add a Data Set called Operations with Row Query Expression:
//Operation
and Row Query Typeuml:Operation
- Add the following Column Mapping with
name
,@name
, andString
in the first Column Query row anduri
,getURI(.)
, andString
in the second Column Query row:
- Add a new data set called OperationsWithPre
- Add a Query Parameter called:
opuri
- Add a Row Mapping by browsing to Operation >Precondition (This will add the Row Query Expression:
precondition
), changing it to:resolveURI($opuri)/precondition
and selecting the Row Mapping Type:uml:Constraint
- Add a Column Mapping with
name
,@name
, andString
in the first row of the Column Query
- Repeat Steps 5-8 to create similar data sets called OperationsWithBody for the
bodyCondition
listand OperationsWithPost for thepostcondition
list
- Add a new list to display the information on the report
- Add a label with the text Operations in the Header of the list
- Bind the list to the Data Set > Operations. In the first row of the Data Column Binding, theName will be
Column Binding
, Display Name will beuri
, the Data Type will beString
, and the Expression will bedataSetRow["uri"]
. TheColumn Binding (uri)
will be used to determine the value of the parameteropuri
in the nested table bound to theData Set > OperationsWithPost. Add a new table inside the List Detail section. The table should have one Column and one Detail.
- Bind the table to the Data Set > OperationsWithPre
- Click on Data Set Parameter Binding...
- Bring the parameter
opuri
to theColumn Binding
from the Data Set > Operations, as follows:
- Select the parameter, then click on the Edit button. This opens the Edit data set parameter binding dialog below:
- Click on the f x button. This opens the Expression Builder, from which you can make selections:
- Add a label in the Table Header with the text Preconditions
- Drop the name column of the Data Set > OperationsWithPre into the Table Detail
- Repeat the Steps 13-18 and create two tables, one for OperationsWithBody and one forOperationsWithPost. It may be easier to use the Outline view to arrange the tables inside the list:
The Report layout will look as follows:
The Report preview will look as follows:
An sample model and report are attached to this document. They were created using IBM Rational Software Architect 8.5:
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.5;8.0.4.1;8.0.4;8.0.3;8.0.2;8.0.1;8.0","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":"8.0;8.0.1;8.0.2;8.0.3;8.0.4;8.0.4.1;8.5","Edition":"","Line of Business":{"code":"LOB15","label":"Integration"}}]
Was this topic helpful?
Document Information
Modified date:
10 September 2020
UID
swg21617033