Question & Answer
Question
How do I add information such as model element documentation to BIRT reports?
Answer
The following table lists different information types and how to include them in a BIRT report.
Use the information in the table only for the 7.0.5.x releases.
For release 7.5 and higher, use the information provided in the product help, which shows how to take advantage of the improved capabilities of the reporting feature: http://publib.boulder.ibm.com/infocenter/rsmhelp/v7r5m0/index.jsp?topic=/com.ibm.ccl.erf.doc/topics/t_create_report_specifics.html
Note: For instructions about how to join data sets and how to write custom XPaths, see the on-line help in the product.
| Information to include in report | Corresponding report design element |
| Documentation for model elements | To add the documentation of a model element to a report design, add the following column mapping to the data set:
Use a dynamic text element for this column, not a label element. With dynamic text, the documentation in the report is formatted the same way as in the model; with a label, HTML tags are generated in the report. The function getElementsWithStereotype is included with your IBM® Rational® product. |
| List of profiles that are applied to a model | For an example, see the Applied Profiles data set in the Blank UML Model Report (blankUMLModelReport.rptdesign), which you can access from the Report Explorer view. |
| List of stereotypes that are applied to an element | This requires a custom XPath function. |
| List of classes that are directly in a package | Construct a report with several nested layers: the model name and documentation, with a list of all top-level packages; under each package, a list of all classes in the package (name and documentation); and under each class, a list of all attributes with name, types, and visibility. Join the data sets Package (name, uri) and Class (name, container uri) by using the URIs. For the URIs, use the following XPath functions:
You can use a variation of this approach to include a list of subclasses in a package. |
| List of attributes that are in a class, with their types | For an example, see the Classes with Attributes data set in the Blank UML Model Report (blankUMLModelReport.rptdesign), which you can access from the Report Explorer view. |
| List of operations that are in a class, with their return types | For an example, see the Classes with Attributes data set in the Blank UML Model Report (blankUMLModelReport.rptdesign), which you can access from the Report Explorer view. This is similar to including a list of attributes in a class, but you use operations instead of attributes. |
| List of parameters (other than “return”) that are in an operation, with their types | Join the data sets Operation (name, uri) and Parameter (name, containerURI) by using the URIs.
For the URIs, use the following XPath functions:
To filter the return parameters, use the following parameter table mapping: oclQuery(//Parameter,"self.direction <> ParameterDirectionKind::return") This means "match all parameters whose type is not ParameterDirectionKind.RETURN." |
| List of exceptions that an operation throws | This requires a custom XPath function. |
| List of all classes that implement an interface | Join the data sets Class table (name, uri) and Realization table (name, sourceURI, sourceName) by using the URIs.
For the URIs, use the following XPath functions:
|
| List of all interfaces that a class implements | This is a variation of the preceding item. |
| List of all classes that inherit from a class | For an example, see the Subclasses data set in the UML Model Metric Report (umlModelMetrics.rptdesign). |
| List of all classes that a class inherits from | This is a variation of the preceding item. |
| List of the fully qualified names of all classes that a class has a directed association to, with target role name, visibility, and multiplicity | This requires a custom Xpath function. |
| Use cases associated to an actor | Create an Actor data set with //Actor as the table-mapping XPath expression and the following column mappings:
Create an Association data set with //Association as the table-mapping XPath expression and the following column mappings:
Join the Actor and Association data sets by using the URIs. |
| Actors associated with a use case | This is a variation of the preceding item. |
| For a class diagram, a list of classes that are in the diagram | This requires a custom XPath function. |
| For a sequence diagram, a list of object names and types of the lifelines | Join the data sets Interaction (name, uri) and Lifeline (name, containerURI) by using the URIs. |
| For a sequence diagram, for each lifeline, which messages go to that lifeline | This requires a custom XPath function. |
| For a sequence diagram, a list of only the top-level messages | Join the data sets Interaction (name, uri) and Messages (name, containerURI) by using the URIs. |
| For a structured classifier, a list of ports | Join the data sets EncapsulatedClassifer (name, uri) and Port (name, containerURI) by using the URIs. |
| For a port, a list of provided interfaces | This requires a custom XPath function. |
| For a port, a list of required interfaces | This requires a custom XPath function. |
| For an activity diagram, a list of partitions | Join the data sets Activity (name, uri) and ActivityPartition( name, activityURI) by using the URIs.
For the URIs, use the following XPath functions:
Here, inActivity is an ActivityPartition attribute. |
| For an activity diagram, a list of datastores | Join the data sets Activity (name,uri) and DataStore (name, activityURI) by using the URIs.
For the URIs, use the following XPath functions:
Here, activity is a DataStoreNode attribute. |
| For an activity diagram, a list of central buffers whose classifiers have a particular stereotype | This requires a custom XPath function. |
| For an activity diagram, a list of types in object flows | This requires a custom XPath function. |
| For a state diagram, a list of state names | Join the data sets Statemachine (name, uri) and State (name, statemachineURI) by using the URIs.
For the URIs, use the following XPath functions:
|
| For a state in a state diagram, a list of transitions to which states | Join the data sets Statemachine (name, uri) and Transition (name, containingStatemachineURI) by using the URIs.
For the URIs, use the following XPath functions:
Display the transition source and target vertices. |
Was this topic helpful?
Document Information
Modified date:
29 September 2018
UID
swg21296924