Before you start
Learn what to expect from this tutorial, and how to get the most out of it.
IBM® Rational® Software Modeler and IBM® Rational® Systems Developer V7.0.5 (and later) deliver integration for IBM® Rational® UML models into Business Intelligence and Reporting Tools (BIRT), an extensible open-source Eclipse-based reporting system. You can design reports graphically in the BIRT report design editor. You can then use the BIRT report designs to render reports on any Rational UML model (in either HTML or PDF formats).
This tutorial will demonstrate how to design and run a simple report on a UML business model. The purpose of the tutorial is to teach the basics of model reporting, and it will focus on how to extract model data into a BIRT report. It will not elaborate on how to use BIRT itself, which is material covered at length in other books and online resources.
You should be familiar with the following:
- Basic concepts of UML modeling
- Rational Software Modeler
- XML Path Language (XPath)
- UML V2.1 Superstructure Specification
The following software needs to be installed before you can perform the exercises in this tutorial.
This example is used to demonstrate reporting on a UML model to which the Rational Business Modeling profile has been applied. The model consists of a small number of business use cases and business actors for a catering business.
The report that you create in this tutorial will contain the following information extracted from the model:
- Model title and documentation, which demonstrate how to display model documentation as rich text
- Use case diagrams, which demonstrate how to add UML diagrams to the report
- Business use cases and some of their stereotype attributes, which show how to report on stereotyped model data
- Business actors and their associated use cases, which show how to report on grouped model data
There are six lessons in this tutorial. The first lesson details how to unzip and import the project that contains the UML models that will be used in the subsequent lessons. The project also contains a generic version of the report design file that will be created in this tutorial, if you wish to skim lessons two through five, which describe how to build the BIRT report design file. Lesson six shows you how to render the final report on the catering business model.
BIRT reports obtain data from data sources and data sets. A data source specifies where to obtain the report data. In model reporting, the data source is a set of meta-models, and each data set contains XPath expressions that use the metamodel structures to query for data from an instance model at runtime.
A data set specifies what data to obtain, and how to obtain it. For a model report, each data set describes a tabular representation of data extracted from the model, and consists of two parts:
- A table mapping that is an XPath expression, which finds the model objects that form the rows of the table
- A column mapping that is a set of XPath expressions, which find attributes of those model objects, forming the columns of the table
The XPath language is used to express queries for both the rows and columns of each UML model data set. In Rational Software Modeler and Rational Systems Developer (V7.0.5 and later), the parser used for these expressions is Eclipse modeling framework (EMF)-aware. This means that you can write expressions that navigate the in-memory structure of the model. For example, you can create a data set of all of the UML Actors in the model using //Actor, even though in the XML document for the model there is no such node as "Actor."
IBM® Rational® Software Architect and Rational Systems Developer (V7.0.5 and later) contribute XPath functions that can be used in these expressions to manipulate model data, such as
getURI(), which finds the URI of a model element. A complete list of available functions is available from the Publishing and generating reports on UML models > Designing model information reports > Additional XPath functions for EMF and UML data sets topic in the product documentation. The XPath execution is also client-extensible through custom XPath functions using the org.eclipse.jet.xpathFunctions extension point.