© 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An...

41
© 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational Modeling Tools [email protected] MAC09 © 2009 IBM Corporation Steven Hovater Senior Managing Consultant Rational Lab Services [email protected]

Transcript of © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An...

Page 1: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

© 2009 IBM Corporation

MAC09

Model Reporting with IBM® Rational®Software Architect 7.5: An Introduction

Maged ElaasarSenior Software EngineerRational Modeling [email protected]

MAC09

© 2009 IBM Corporation

Steven HovaterSenior Managing Consultant

Rational Lab [email protected]

Page 2: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

2MAC09

Objectives of this Presentation

Introduce you to model reporting with BIRT in RSx 7.5

Walk you through the process of authoring and generating a model report

Give you insight about report authoring decisions and their implications

Educate you on some interesting details of report authoring

Give you a demo showing tips and tricks of using the tool.

Page 3: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

3MAC09

Outline

Why model reporting?

Evolution of model reporting in RSx

Introduction to BIRT

BIRT reporting process

Demo of model reporting in RSx 7.5

Success stories

Page 4: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

4MAC09

Why Model Reporting?

Models represent repositories of intellectual investment

Typically you need to be a modeler to be able to distill info from and reason about models

Model reporting gives you the ability to represent selected model info to non-modelers Example: how many use-cases do we have? How many scenarios associated with them?

Example: what layers do we have in the architecture and what dependencies do they have?

Model Report

Page 5: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

5MAC09

Evolution of Model Reporting in RSx

Pre-7.0.5 : XSLT-based model reporting, Java-based model reporting

WDoc (Java API to MS Word)

7.0.5 : Initial support for BIRT-based model reporting

7.5 : Enhanced support for BIRT-based model reporting Enhanced performance, usability and extensibility

Added more report authoring features, prepackaged API and sample reports

Simplified report generation and supported more output formats

Post-7.5 : Learn by talking to product management Product Manager: William (Bill) T. Smith ([email protected])

UML to XMLTransformationUML XML

XSLT TemplateReport

BIRT TemplateEMF DriverDSL Report

BIRT TemplateUML DriverUML Report

Model to ModelTransformationUML/DSL Report DSL

BIRT TemplateEMF Driver Report

Page 6: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

6MAC09

What is BIRT?

BIRT - Business Intelligent Reporting Tools

Created by Actuate, Inc., released to Eclipse as open source project

Provides visual report authoring experience

Supports a variety of report content (text, tables, charts…etc)

Creates various report output formats (HTML, PDF, DOC, …etc)

Natively works with data in tabular format

Provides Open Data Access (ODA) interface to support data from arbitrary formats Prepackaged with drivers for SQL databases, XML, flat-files, web-services

Used by RSx to implement a generic driver for arbitrary EMF-based model reporting

EMF driver is extended by specific drivers for UML, Deployment and Data domains

Page 7: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

7MAC09

BIRT Basics

Open Data Access (ODA) Driver Establishes a connection with a data source, accesses metadata about the data, maps the

data to a tabular format, and executes queries on the data

Data Source The ‘raw’ data being reported on

Data Set A subset of the data source that is fetched using a query and mapped to a tabular format

that can be used by BIRT report template.

Page 8: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

8MAC09

3. Create Report Configuration

2. Create Report Design Template

BIRT Reporting Process1. Identify Report

Requirements

a. Create data sources

b. Create data sets

d. Create report design

c. Create report

parameters

e. Preview report

a. Bind data sources

b. Configure report output

c. Bind report parameters

d. Hook front transformation

e. Run report

Report Author

Report Author

Report User

Page 9: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

9MAC09

1. Identify Report Requirements

Identify the data domains to report on Learn what domains are supported

Any EMF-based domain (e.g. UML, Deployment, Data, Diagram…etc)

Available integration with ReqPro when installed

Learn the used metadata (metamodels, profiles, schemas…etc)

Example: UML metamodel, Profile for business modeling, Notation metamodel…etc

Learn their query languages (OCL, XPath, SQL…etc)

Supported versions: OCL version 2.0 and XPath 1.0

Identify the subset of data to be included in the report Think of the queries that need to be made to extract this data from data sources

Identify the required presentation and layout options in the report Think of the report widgets to use, their layout relative to each other…etc.

Page 10: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

10MAC09

For More Information About Domains

Standard specification documentation UML 2.0 Specification (www.omg.org/spec/UML/2.0/)

OCL 2.0 specification (www.omg.org/spec/OCL/2.0/)

XPath 1.0 specification (www.w3.org/TR/xpath)

Various standard DSLs/Profiles (www.omg.org)

Eclipse open source project documentation UML2 project –UML metamodel (www.eclipse.org/modeling/mdt/?project=uml2#uml2)

OCL2 project – OCL tools (www.eclipse.org/modeling/mdt/?project=ocl#ocl)

GMF project – Diagram/Notation metamodel (www.eclipse.org/modeling/gmf)

Other metamodel implementations (www.eclipse.org/modeling/mdt/)

Your success with reporting is dependent upon your understanding of the structure of the domain data and how to navigate to it and extract it.

Page 11: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

11MAC09

2. Create Report Design Template

Change to the Report Design perspective

Create a new Report Project

Create a new Report

Report Data

Report Widgets

Report Design / Layout

Report Properties

Page 12: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

12MAC09

2.a. Create Data Sources Choose the most specific data source for the data domain:

Domain-specific data sources (e.g. UML Data Source, Zephyr Topology Data Source…etc)

EMF Data Source if your domain is EMF-based but does not have a specific data source

Data sources specify how to access data repositories and their metadata For UML: data are EMX / UML models (optional for preview)

For UML: metadata are UML2 / Notation metamodels and used profiles

Create one data set for each related set of data repositories (i.e. models)

Page 13: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

13MAC09

2.b. Create Data Sets

Data sets define queries against data sources and put the result into a tabular format (with rows and columns)

Select the data source of this data set

Define data set parameters (for reusable data sets): Query Parameters tab: define parameters’ native names

Parameters tab: define other attributes of parameters

Page 14: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

14MAC09

2.b. Create Data Sets Row mapping: specifies a query to collect model

elements representing the rows of a table

Browse data source models using the LHS browser

Specify the row query using the RHS fields: Expression: an XPath query that collects elements

Type: the type of elements being collected

Stereotypes: the relevant stereotypes applied to elements being collected Metamodel Browser

Profile BrowserInstance Model Browser

Page 15: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

15MAC09

Row Query XPath Expression

The expression’s context is the instance models in the data source

The expression’s return value is a collection of elements (no scalar values)

The expression consists of model traversals, calculations, searching, filtering…etc

Each model traversal in the expression Starts from the model root “/elem/ref”, a parameter “$elem/ref” or the context “elem/ref”

Consists of a series of traversal steps : step 1 / step 2 /…/ step N

Where each step describes going to a related set of objects for each object of previous step

Resolves into the result of the last step

The expression can invoke XPath functions (implemented in java)

Page 16: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

16MAC09

XPath Functions Prepackaged EMF-Generic Functions

getURI( xpath ) gets the URI of a given element

resolveURI( uri ) resolves the given URI to its element

instanceOf( xpath, type ) checks if a given element conforms to a given type

getXMIID( xpath ) gets the unique GUID of an element

getXMIType( xpath ) gets the type of an element

oclQuery( xpath, OCL statement ) gets a subset of given elements that satisfy given OCL condition

oclEvaluate( xpath, OCL statement ) evaluates the given OCL expression on the given element

Prepackaged GMF-Specific Functions getDiagramImage( xpath, maxWidth, maxHeight ) renders given diagram subject to given maximum resolution

getDiagramHTMLImage( xpath, path, tileWidth, tileHeight ) renders the given diagram as HTML tile grid

Prepackaged UML-Specific Functions getDiagrams( xpath ) gets the diagram of the given UML namespace element

getElementsWithStereotype( xpath, stereotype ) gets a subset of given elements with given stereotype

getStereotypePropertyValue( xpath, stereotype attribute ) gets value of a given stereotype attribute

Custom Functions Implement org.eclipse.jet.xpath.XPathFunction interface with one method Object evaluate(List args)

Package implementation in a PDE plugin and register it with the org.eclipse.jet.xpathFunctions extension point

Page 17: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

17MAC09

Row Query Examples

To get Query expression

All interfaces //Interface

All kinds of classes instanceOf(//*, “uml:Class”)

All first level packages Model/nestedPackages

All class diagrams contained by any package getDiagrams(//Package)[@type = “Class”]

All attributes of a class parameter resolveURI($classURI)/ownedAttribute

All interfaces whose owner’s name is specified //Interface[owner/@name=$owner_name]

All diagrams whose name starts with the “st” getDiagrams(//*)[upper-case(substring(@name,1,2))='ST']

All classes matching the given OCL expression oclQuery(//Class, “isAbstract and self.ownedAttributes->isEmpty()”)

All classes with a given stereotype getElementsWithStereotype(//Class, “Profile1::Stereotype1”)

Page 18: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

18MAC09

2.b. Create Data Sets

Column mapping: specifies queries to extract various data from row elements

Browse row type / stereotypes using LHS browser

Specify column queries using the RHS table: name: user specified name for the column

query: XPath expression to extract primitive data from each row element

type: the primitive type of the query result

Use context-sensitive column auto add button

Recommended to have one column as a unique key Use URI for EMF elements: getURI(.)

Type Browser

Stereotype Browser

Page 19: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

19MAC09

Column Query XPath Expression

The expression’s context is each element collected by row query

The expression’s return value is a scalar of one of the standard primitive types

The expression’s return value is a single value (no collections)

The expression can explicitly refer to the context element by using “.”

An expression navigating to an attribute will be of the same type as the attribute Only exception is boolean attributes: use @attribute = ‘true’ to make the type boolean

Any expression can be converted to a string by setting the type to ‘String’

Page 20: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

20MAC09

Column Query Examples

To get Query expression

The name of the element @name

The URI (unique id) of the element getXMIID(.)

The type of the element getXMIType(.)

The isAbstract attribute of a class @isAttribute = ‘true’

The count of attributes of a class count(/.ownedAttribute)

The diagram’s image blob up to a maximum resolution getDiagramImage(., $maxWidth, $maxHeight)

The diagram’s image as an HTML grid of tiles getDiagramHTMLImage(., /temp, $tileWidth, $tileHeight)

A value derived using an OCL expression oclEvaluete(., “self.getQualifiedName()”)

A value of a stereotype attribute getStereotypePropertyValue(., “Profile1::Stereotype1::property1”)

Page 21: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

21MAC09

2.b. Create Data Sets

Computed Columns

FiltersPreview Results

Other Data Set Operations

Page 22: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

22MAC09

2.b. Create Data Sets

Joint Data Sets

Page 23: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

23MAC09

2.c. Create Report Parameters

Report parameters allow authors to capture variability in a report

Report parameters can be configured with various styles and presented with various widgets

Text Box

Static Combo BoxDynamic Combo Box

Page 24: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

24MAC09

2.c. Create Report Parameters

Report parameters can be linked to data set parameters

Report parameters can be used in report design directly

Page 25: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

25MAC09

2.d. Create Report Design

Use the palette view to insert various widgets in your reports

Static text

HTML Text

Computed Text (Static / HTML) e.g. for model doc

Image : embedded, from URL, from expression, e.g. for diagrams

Table with rows / columns

Chats of various kinds

Page 26: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

26MAC09

2.d. Create Report Design Link the report widgets to data in your data sets

Page 27: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

27MAC09

2.d. Create Report Design Model diagram images an be reported on in two ways:

Do you want to Include diagrams at full size or scaled?

How much memory do you have to render diagram images?

1. Sampled Image 2. HTML Tiled Image

Page 28: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

28MAC09

2.d. Create Report Design

Nested tables can be done with parameterized data sets

$element

$stereotype

$element

Page 29: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

29MAC09

2.e. Preview Report

Frequently preview the result of the report to validate design

Enter the parameter values for parameterized reports

Page 30: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

30MAC09

3. Create Report Configuration Once a report design template is finished, it is ready for generation by users

Bring up the report configuration wizard From the modeling perspective toolbar, select the “Report” button

Or right click on a .rptdesign file in Project Explorer and select “Report As” menu

Create a new BIRT report configuration

Choose a report design template from the main tab Built In reports: select one of the prepackaged reports

Location: browse to the location of the .rptdesign file

Page 31: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

31MAC09

Prepackaged Sample Reports

Demonstrates how to report on numbers & bind data to charts

Demonstrates how to include sampled diagram images

Demonstrates how to include tiled diagram images

Demonstrates how to use HTML text and create tables

Demonstrates how to create nested tables

Page 32: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

32MAC09

3.a. Bind Data Sources

For every data source in a report design template: Add the actual instance models (e.g. EMX models)

This will replace the sample instance models

Page 33: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

33MAC09

3.b. Configure Report Output

Configure the report output by selecting: The path to the generated report file

The format of the report from supported formats: HTML

PDF

PS

DOC

PPT

XLS

Page 34: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

34MAC09

3.c. Bind Report Parameters

Bind the report parameters from the parameters tab Set the parameter values using the same UI

Clear parameter values to unset the values

Unset parameters take default values if any

Page 35: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

35MAC09

3.d. Hook Front Transformation

Hook a front M2M transformation if required Report is created with one domain while various

transformations exist from other domains to it

Transforms instance models bound to data sources and replaces them with the resulting models

Transformations can be defined visually using M2M transformation authoring framework in RSx

Page 36: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

36MAC09

3.e Run Report

Once a report configuration is ready, the report can be generated repeatedly User would be prompted for any unbound report parameters

Page 37: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

37MAC09

Page 38: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

38MAC09

Success Stories Customers realize that BIRT provides an ad-hoc query capability

Use those UML models you’ve invested in!

Customers using BIRT for model reporting (to name a few!) ACS

Boeing

Serco

Raytheon

US Navy

US Army

Northrup-Grummond

IBM Rational UPIA/IAM2 Produce DoDAF/MODAF products from UML models

Page 39: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

39MAC09

For More Information About Model Reporting With BIRT

developerWorks Articles: http://www.ibm.com/developerworks/rational/library/07/1211_hovater/ 

http://www.ibm.com/developerworks/edu/dw-r-umltracebirt.html 

http://www.ibm.com/developerworks/edu/dw-r-umltracebirt2.html

http://www.ibm.com/developerworks/rational/library/edge/08/jan08/densmore/

Page 40: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

40MAC09

Page 41: © 2009 IBM Corporation MAC09 Model Reporting with IBM® Rational® Software Architect 7.5: An Introduction Maged Elaasar Senior Software Engineer Rational.

IBM Rational Software Conference 2009

41MAC09

© Copyright IBM Corporation 2009. All rights reserved. The information contained in these materials is provided for informational purposes only, and is provided AS IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, these materials. Nothing contained in these materials is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software. References in these materials to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities referenced in these materials may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. IBM, the IBM logo, Rational, the Rational logo, Telelogic, the Telelogic logo, and other IBM products and services are trademarks of the International Business Machines Corporation, in the United States, other countries or both. Other company, product, or service names may be trademarks or service marks of others.