Jazz

99
CLM 3.0 - Traceability reports for a lifecycle project with RPE Oana Hategan Reporting Arena Team Member www.reportingarena.com

description

 

Transcript of Jazz

Page 1: Jazz

CLM 3.0 - Traceability reports for a lifecycle project with RPE

Oana Hategan Reporting Arena Team Memberwww.reportingarena.com

Page 2: Jazz

2

About the author

Reporting Arena part of E Global Business Solutions Group helps clients effectively implement and leverage the suite of IBM Rational Software. As a group of consultants who are focused on Rational Publishing Engine, our team has a big advantage beside our competitors, being the team who actually developed this tool.

With years of experience honed in software development, our staff brings skills and experience you can draw on to help you improve your team's software development capability and maximize the return on your investment in IBM Rational Software tool

Page 3: Jazz

3

Reporting Arena Services

Implementation of Rational Publishing Engine RPE Template Design and Optimization Custom Solutions for IBM Rational Publishing Engine Migrating Legacy Solutions to Rational Publishing Engine Rational Publishing Engine Training Integrate RPE in Rational Tools Packaged Services

Page 4: Jazz

4

Introduction

The goal of this tutorial is to present the basic steps that a user has to perform in order to extract data from a specific CLM Module, and to follow links to get information from all linked modules.

Also in this tutorial the user can find information about CLM Schema Discovery process, advance filtering using JavaScript expressions, fancy table formatting and some valuable information about defining and using variables in master pages.

Page 5: Jazz

5

Prerequisites

Microsoft Windows XP/Vista/7 Rational Publishing Engine 1.1.2 Rational Team Concert 3.0 Rational Requirements Composer 3.0.1 Rational Quality Manager 3.0.1 Microsoft Word 2003/2007 (to visualize the output document) Basic knowledge of using Rational Publishing Engine Basic knowledge of using Rational DOORS Basic knowledge of XML language, XML schema definitions and JavaScript

language CLM username and password

Page 6: Jazz

6

Output Document Description

I am looking to create a traceability document containing RRC Requirements, RQM Test Plans and related Test Cases and RTC Work Items. Each of the above modules will be represented by a table with entries for each module element and links to elements description. The document will offer the option of tracing a requirement or a test case from a specific work item.

Also, a master page will be created, having a title page section and a header displaying the document generation time. The template’s footer will contain the current page number.

Page 7: Jazz

7

Use Case 1/2

Steps to obtain the desired Output Document:

1. Create a template for a report containing RRC requirements Iterate through all the requirements and display the ID, Title, Type and

Modified attributes, if they are not empty. For a Collection of Requirement we will display the nested requirements. Each table entry will be linked to a more detailed description of the requirement. [add XML schema, create paragraphs, tables, containers, drag queries, use conditions]

2. Create a template for a report containing RTC work items Iterate through all the work items and display the ID, Summary, Target,

Owner, Project Area and Priority attributes, if they are not empty. Each work item will have a link to the implemented requirement and corresponding test case, as well as a task description. [add XML schema, create paragraphs, tables, containers, drag queries, use conditions]

Page 8: Jazz

8

Use Case 2/2

3. Create a template for a report containing RQM test plans and test cases Iterate through all the test plans and display the ID, Name, State, Owner,

Release and Modified attributes, if they are not empty. Each test plan will have a link to the related test cases and each test case and test plan will be linked to a detailed description, requirement and corresponding test case, as well as a task description. [dynamic data source configuration, create paragraphs, tables, containers, drag

queries, use conditions]

4. Add additional template structures like: Table of Contents , Table of Tables and Master Page

Page 9: Jazz

9

Tutorial Outline

1. Requirements section

2. Work items section

3. Test plans and test cases section

Page 10: Jazz

10

Requirements - Checkpoint

1. Iterate through all the requirements and display some attributes

2. For each Collection display the related requirements

3. Create a detailed description for each requirement

4. Link the table entry to the requirement description

5. Create a master page with header and footer6. Configure Document Specification

Page 11: Jazz

11

Header section: on left side: generation time

Table Header

Collection and related requirements

Footer sectionpage number / total pages number

Desired Output Document

Requirement description

Page 12: Jazz

12

Add an XML data source 1/2

The first step is to open the Rational Publishing Engine in Studio perspective.

Go to File menu, and select New->Document Template

To extract information from CLM we need to have in our template the corresponding XML data source schema.

Add an XML data source schema using the Data Source Schemas entry from the Outline view.

Right click, and select Insert->Data Source Schema…

Page 13: Jazz

13

Add an XML data source 2/2 In the Add Data Source Schema

wizard, on the second page, select the default REST schema, using schema type REST, and, as Data Source ID, type : “REST_rm”

Click Finish to insert the schema into the template.

In the Schema file field, insert the data schema URL:

https://server_name:port/rm/publish/resources?metadata=schema Introduce CLM username and

password in the User Authentication Box

NOTE: The XML file containing all current resources:

https://server_name:port/rm/publish/resources/*

Page 14: Jazz

14

Set dataSource/Artifact Query

Create a Table: Select the Table element in the Palette view and click in the desired location in the Template Content Editor.The first row will be the table’s header.

Set the dataSource/artifact query [$1] to the Container: Drag the desired query from the Data Source Schemas view and drop it on the Container.

NOTE: It’s recommended to use the Container element when you want to iterate a collection of elements. The container element will not add extra empty paragraphs.

Iterate elements: Select a Container and drop it inside the created table. Use drag and drop to add the second row inside the Container. This row will be iterated for each dataSource/artifact element.

Page 15: Jazz

15

Display Requirement attributes

Add a Text element in each first row cell. Double-click on each Text element to modify the Text content. Add the attributes names in each cell. Right-click on each cell and select the Header Style.

Expand the Artifact element from the Data Source schema, and drag the Identifier attribute into the first cell’s text box. Select Use as value context. Do the same for the rest of the cells.

In this moment in our template we iterate through all artifacts, and display for each of them five attributes, each one in a separate table cell.

NOTE: The attributes from the data schema can be better understood by looking at the XML file

https://giediprime:9445/rm/publish/resources/*

Page 16: Jazz

16

Change Date Format 1/2

I used a JavaScript expression to change the date format. Double-click on the Text element and select Script expression.

Initial format Modified format

The initial format is the format in which the date is stored in the dataSource/artifact/collaboration/modified element. The modified format is the date format after applying the JavaScript expression.

Page 17: Jazz

Convert the date value to string

p3 stores the time (hour:min:sec)

str[0] -> yearstr[1] -> monthstr[2] -> daystr[3] -> hour:min:sec

p1 stores the date (yyyy-mm-dd)

17

Change Date Format 2/2

i stores the number of the month

The JavaScript expression splits the date string into year, month, day and time. To convert the month format( ex “06” -> “Jun”) we use the month number as an index for the months array. Next, we compose the output by concatenating the month number with the day, year and time.

NOTE: You need to check the used attributes in the left side of the Script Expression container.

Page 18: Jazz

18

Requirements - Checkpoint

1. Iterate through all the requirements and display some attributes

2. For each Collection display the related requirements

3. Create a detailed description for each requirement

4. Link the table entry to the requirement description

5. Create a master page with header and footer6. Configure Document Specification

Page 19: Jazz

19

Iterate the Collection elements 1/4

In order to display the requirements contained by a Collection , we need to modify the previous table. We want the related Requirements names to appear bellow the Collection name.

In the XML file you can see that the object type (requirement or collection) is the value of the dataSource/artifact/collaboration/ attributes/ObjectType element.

If the ObjectType/name is “Collection”, it means we have to display the elements of type requirement contained by it.

XML content for object type

Requirement

XML content for object type Collection

Page 20: Jazz

20

Iterate the Collection elements 2/4

Expand the dataSource/artifact/collaboration/ attributes/ObjectType element and drag it inside the second row.

Add a new internal variable called type that will store the element type – Requirement or Collection.

Right-click on the second row, Data ->Edit Assignments. Choose Add and select the variable called type from the list of variables. In the Set assignments for current element box, go to Data Expression and select dataSource/artifact/collaboration/ attributes/ObjectType/name. In this way, the variable called type will store the Object Type value and can be used inside this row.

Page 21: Jazz

21

Iterate the Collection elements 3/4

Add a Container element to the Name cell to iterate all the requirements of the Collection. These requirements are stored inside the XML by the dataSource/artifact/traceability/links/Link elements.

Add a List element inside the Container. Use a script expression to display the requirement’s identifier followed by name for each Collection element.

NOTE: Select an element inside the template and

choose Zoom Editor. The Zoom editor places the focus on a specific template element and provides better visibility.

Page 22: Jazz

22

Iterate the Collection elements 4/4

In order to display the list of related requirements only if the main requirement is a Collection, we need to add a condition to the Container that iterates the Link elements. There are two ways to create script conditions using this editor:

Right-click on the element and select Data->Edit Condition.

1) Use embedded operations (right part) to create simple conditions.

2) Drag the operands from the left side and create complex conditions using JavaScript language.

NOTE: Each time it’s recommended to test your condition using the Test Script Expression Dialog, by pressing the Test button.

The match() method searches for a match between a regular expression(patt1) and a string (str) , and returns the matches.

The condition is true only if the element name contains the string “collection”

Page 23: Jazz

23

Requirements - Checkpoint

1. Iterate through all the requirements and display some attributes

2. For each Collection display the related requirements

3. Create a detailed description for each requirement

4. Link the table entry to the requirement description

5. Create a master page with header and footer6. Configure Document Specification

Page 24: Jazz

24

Set dataSource/Artifact Query

Create a Table: Create a table with eight rows and four cells bellow the requirements table.

Set the dataSource/artifact query to the Container: Drag the desired query from the Data Source Schemas view and drop it on the Container.

NOTE: It’s recommended to use the Container element when you want to iterate a collection of elements. The container element will not add extra empty paragraphs.

Iterate elements: Insert a Container element and drag the Table inside the container. The table will be iterated for each dataSource/artifact element.

Page 25: Jazz

25

Advanced Table formatting 1/2

• Create a new style for cells

• Go to Outline view, right click on Styles node, and select Insert->New Style… option.

• New Style Wizard will open

• Set the style name: cellStyle

• In the Select Style Properties page, select the cell element, and add it to the result list.

• Go to the last page and press Finish. The style will be added into the Styles node.

Page 26: Jazz

26

Advanced Table formatting 2/2

Configure cellStyle

Select the style in the Outline view

Go to Properties view

Set cell->border->all borders color to white (“FFFFFF”)

Set cell->border->all borders style to “none”

Set cell->border->all borders width to 0

Add the newly created style to all cells of the table (right-click->Style->cellStyle)

Add the Title Style to the first row of the table

Add the HeaderCell Style and set the cell background

color to “ADD8E6” for all cells in the second, the fourth and the seventh row of the table

Alternatively, you can select the cell background color node and click in the Color button to select a color from the color palette.

Page 27: Jazz

27

Insert the requirement attributes in the table 1/3

The table will contain properties of the Requirement element such as Title, Location, Attributes and Links

The first row contains the title which has a hyperlink back to the requirement table entry.

Set the Hyperlink content to dataSource/artifact/title and place a Bookmark with the same content in the main table

For the location property insert the dataSource/artifact/location/project/title and dataSource/artifact/location/parentFolder/ title values in third row of the table.

Page 28: Jazz

28

Insert the requirement attributes in the table 2/3

The table will contain properties of the Requirement element such as Title, Location, Attributes and Links

To introduce the severity value of the artifact, iterate using a Container all the dataSource/artifact/collaboration/attribute/ ObjectType/customAttribute elements and display the dataSource/artifact/collaboration/attribute/ ObjectType/customAttribute/literalName value only for those custom attributes that have the dataSource/artifact/collaboration/attribute/ ObjectType/customAttribute/name equal to “Severity”

Page 29: Jazz

29

Insert the requirement attributes in the table 3/3

Iterate the dataSource/artifact/traceability/links/Link elements to show all the Requirements connected to the current Requirement

Add a Hyperlink from the link name to the table entry of that Requirement. Set the Hyperlink content to dataSource/artifact/title.

Add a Bookmark with the same content to the second row of the requirements table.

The table will contain properties of the Requirements element such as Title, Location, Attributes and Links

Page 30: Jazz

30

Requirements - Checkpoint

1. Iterate through all the requirements and display some attributes

2. For each Collection display the related requirements

3. Create a detailed description for each requirement

4. Link the table entry to the requirement description

5. Create a master page with header and footer6. Configure Document Specification

Page 31: Jazz

31

Hyperlinks and Bookmarks

We want to create a link from the requirement name in the requirements table to the requirement description

in the Name cell, remove the Text element and insert a Hyperlink element . Set the content of the Hyperlink to dataSource/artifact/identifier.

From the Properties panel on the right side, set the display of the Hyperlink to dataSource/artifact/title.

Place a Bookmark element in the Requirements details table. Set the same content for the Bookmark as for the Hyperlink (dataSource/artifact/identifier).

Following the same procedure, create links from the list of Collection Requirements to the requirement description. The content of the Hyperlink will be dataSource/artifact/traceability/links/Link

/identifier and the Bookmark will be not needed, since we have already inserted it.

NOTE: For a link to work inside a document, set the specific/local and specific/internal properties true The Hyperlink element and the target Bookmark must always have the same Content value

Requirement details table

Requirements table

create a link between two different tables

Page 32: Jazz

32

Requirements - Checkpoint

1. Iterate through all the requirements and display some attributes

2. For each Collection display the related requirements

3. Create a detailed description for each requirement

4. Link the table entry to the requirement description

5. Create a master page with header and footer6. Configure Document Specification

Page 33: Jazz

33

Create Master Page 1/5 Create a Master Page

To create a new master page in RPE go to Outline view, select Master Pages node, and choose Insert->New Master Page…

The Master Page is visible in the Outline view and a new page containing the Master Page is added in the Editor area.

Master Page Name – should be unique

Optional: A short description of this master page

Master Page Orientation(select Landscape orientation)

Size empty – default paper size (In Word A4)

NOTE: In a template there could be more than one Master Page element.

Page 34: Jazz

34

Create Master Page 2/5

Define Header section

1. Insert a Paragraph and a Text element inside of it.2. Insert a java Script expression that retrieves the current generation time for the Text element 3. Set the Paragraph bottom border color to black (Properties->Formatting-> border)

Initiate variable with current date and time

You use the master page to format the look and feel of the page by adding page borders, orientation, margins, color and size and so on. You can also insert a header and footer in your document.

Page 35: Jazz

35

Create Master Page 3/5

Define Footer section

Page Number element (select and drop from the Palette)

Set Paragraph borders

Total Pages Number element (select and drop from the Palette)

Page 36: Jazz

36

Create Master Page 4/5

Set font style in header and footer

1. Select Header element, and in Properties view go to Formatting->font node

set font size to “10”set font family to “Arial”

2. Add the same formatting information to Footer element.

NOTE: To add a master page to an element, right-click the element, select Master Page and the name of the MP you want to add

Page 37: Jazz

37

Requirements - Checkpoint

1. Iterate through all the requirements and display some attributes

2. For each Collection display the related requirements

3. Create a detailed description for each requirement

4. Link the table entry to the requirement description

5. Create a master page with header and footer6. Configure Document Specification

Page 38: Jazz

38

Running the report

Select File->Save to save the template.Select the Launcher Perspective to be able to:

Configure the Data Sources Configure the desired output format

If no output is configured, the document is generated in all four formats

REST Data Source

RPE Template

Page 39: Jazz

39

Configure Data Sources

Select the Data Source, open contextual menu andConfigure Data Source…

Insert the Data Source URL by replacing with your own server name and port and your CLM user name and password.

Page 40: Jazz

40

Work items - Checkpoint

1. Iterate through all the work items and display some attributes

2. Link each work item to the artifacts of type requirement implemented by it and to the test cases that verify it

3. Create a detailed description of each work item4. Create a table that contains only newly added

work items5. Configure Document Specification

Page 41: Jazz

41

Work items table

Desired Output Document

Work Item description

Requirements

Test Cases

Page 42: Jazz

42

Add work items XML data source In the Add Data Source Schema wizard, on

the second page, select the default REST schema, using schema type REST, and as Data Source ID type : “REST_wi”

Click Finish to insert the schema into the template.

Introduce CLM username and password in the User Authentication Box

NOTE: The XML file containing all current resources:

https://giediprime:9445 /ccm/rpt/repository/workitem

In the Schema file field, insert the work items data schema URL (in the same template) :

https://server_name:port/cc m/rpt/repository/workitem?m etadata=schema

Page 43: Jazz

43

Set dataSource/Artifact Query

Create a Table: Select the Table element in the Palette view and click in the desired location in the Template Content Editor.The first row will be the table’s header.

Set the workitem/workItem query to the Container: Drag the desired query from the Data Source Schemas view and drop it on the Container.

NOTE: It’s recommended to use the Container element when you want to iterate a collection of elements. The container element will not add extra empty paragraphs.

Iterate elements: Select a Container and drop it inside the created table. Use drag and drop to add the second row inside the Container. This row will be iterated for each workitem/workItem element.

Page 44: Jazz

44

Display Work Item attributes

Build the work items properties table following the example from Requirements.

The color of the summary attribute in each row depends on the work item state: green - done item red - new item

In this moment in our template we iterate through all the work items, and display for each of them the following attributes: Summary, Planned for, Owner, Project area and Priority, each one in a separate table cell.

NOTE: The attributes from the data schema can be better understood by looking at the XML file:

https://giediprime:9445/ccm/rpt/repository/workitem

Page 45: Jazz

45

Select the font color for work items summary

The font color should be decided depending of the state of the work items. To do this, you need to insert a JavaScript expression in the font color field of the summary Text element.Select each Text element in the summary cell and go to Formatting->font color->Script Expression.

NOTE: You need to check the used attributes in the left side of the Script Expression container.

The work item stateIs contained by the state/name attribute

Page 46: Jazz

46

Work items - Checkpoint

1. Iterate through all the work items and display some attributes

2. Link each work item to the artifacts of type requirement implemented by it and to the test cases that verify it

3. Create a detailed description of each work item4. Create a table that contains only newly added

work items5. Configure Document Specification

Page 47: Jazz

47

Iterate requirements 1/2 Insert a Container element inside the work items table, in the Implements cell from the second row. Use the Container to iterate all the existing requirements.

For each requirement, iterate the links it has. Display the requirement title value only if the work item identifier is the same with the link identifier.

Link the requirement name with its entry in the artifacts table, by setting the hyperlink content to dataSource/artifact/identifier.

Iterate requirements Requirements data source ID Iterate links to work items that

Implement the current rqm

Page 48: Jazz

48

Iterate requirements 2/2

Add a data condition to the list detail element(select the element, right-click and data->edit condition).

The condition is verified only if the current work item id is equal to the identifier of the iterated link.

Page 49: Jazz

49

Insert Data Source Configuration element 1/2

To get data from RQM we need to obtain the necessary information to configure that data source.We need this in order to extract the test cases.

Add a Data Source Configuration element above the work items table, and go to Properties view ->Data and set REST_qm (the name of the RQM data source schema) as target data source.

Create a new Container in the test cases cell, inside the work items table. Add a List element inside the container and set the feed/entry/content/testcase query on the list. We want to display the list of test cases for each work item.

In order to be able to configure the data source, insert first the RQM data source schema following the explanation from Test cases - Add an XML data source.

Page 50: Jazz

50

Insert Data Source Configuration element 2/2

Go to Data Source Configuration Properties->Formatting->dynamic configuration and set the URI

The URI is built by composing the base URL and the corresponding xpath

Base URL https://server:port/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/ <$project_name$>/testcase

Xpath ?fields=feed/entry/content/testcase/*

NOTE: Data Source Configuration elements are used to configure a data source at run-time.

Page 51: Jazz

51

Iterate test cases 1/2

After configuring the QM data source, we can iterate the test cases.

For each test case, iterate the related work items (feed/entry/content/testcase/workitem) in a Container and add the List-detail of the previously inserted List to the Container.

Insert a Hyperlink element inside the List-detail. Set the Hyperlink display to feed/entry/content/testcase/title

Iterate all test cases

For each test case, iterate all the links tothe related work items

Page 52: Jazz

52

Iterate test cases 2/2

We need to set a condition on the List-detail element because we want to display only those test-cases that are related to the current work item.

NOTE: If we compare two attributes with different parents but with the same name (workitem/workItem/href and feed/entry/content/workitem/href), RPE will create an alias name for one of them.

The condition is true only if the href attribute of the current work item equals the href attribute of the work item link from the iterated test case.

Page 53: Jazz

53

Work items - Checkpoint

1. Iterate through all the work items and display some attributes

2. Link each work item to the artifacts of type requirement implemented by it and to the test cases that verify it

3. Create a detailed description of each work item4. Create a table that contains only newly added

work items5. Configure Document Specification

Page 54: Jazz

54

Work item description

Add a Container element and iterate the workitem/workItem elements. We will have a detailed description for each work item.

Insert a table with one column and two rows inside the Container.

The first row will be the table header and will have a Hyperlink to the work item table entry.Insert a Text element in the second row and add the workitem/workItem/description query value to it

The Workitem description table will be iterated for each work item element.

Content: workitem/workItem/

itemID

Content:ret_itemsDisplay:

workitem/workItem/summary

Page 55: Jazz

55

Work items - Checkpoint

1. Iterate through all the work items and display some attributes

2. Link each work item to the artifacts of type requirement implemented by it and to the test cases that verify it

3. Create a detailed description of each work item4. Create a table that contains only newly added

work items5. Configure Document Specification

Page 56: Jazz

56

RPE Filters 1/2

We will use the same table format and same data as for the work items table. We want this time to create a table that contains only newly added work items, by using a scripted filter.

Add a Container element to the second row of the work items table. Cut and Paste the Data Query from the table row inside the Container. Add the workitem/workItem/state query inside the row so that the data can be filtered using the workitem/workItem/state/name value.

Page 57: Jazz

57

RPE Filters 2/2

In order to filter the work items iterations:

Select the table row that contains the work item attributes

Go to Properties panel, Data ->Filter ->Scripted filter and insert the filtering condition

NOTE: RPE filters are processed when data is extracted from the data source. When using conditions, all data is extracted and only after that the condition is applied.

Page 58: Jazz

58

Work items - Checkpoint

1. Iterate through all the work items and display some attributes

2. Link each work item to the artifacts of type requirement implemented by it and to the test cases that verify it

3. Create a detailed description of each work item

4. Create a table that contains only newly added work items

5. Configure Document Specification

Page 59: Jazz

59

Configure Data Sources

Select the Data Source, open contextual menu andConfigure Data Source…

Insert the Data Source URL by replacing with your own server name and port and your CLM user name and password.

Page 60: Jazz

60

Test plans - Checkpoint

1. Iterate through all the test plans and display some attributes

2. For each test plan display the related test cases

3. Iterate through all the test plans and display some attributes

4. Create a detailed description of each test case and link the table entry with the description

5. Create a detailed description of each test plan and link the table entry with the description

6. Add title page7. Add Table of Contents8. Configure data sources

Page 61: Jazz

61

Desired Output Document

Page 62: Jazz

62

Add an XML data source In the Add Data Source Schema

wizard, on the second page, select the default REST schema, using schema type REST, and, as Data Source ID, type : “REST_qm”

Click Finish to insert the schema into the template.

In the Schema file field, insert the data schema URL: https://giediprime:9445/qm/service/com.ibm.rqm.integration.service.IIntegrationService/schema/feed.xsd

Introduce CLM username and password in the User Authentication Box

NOTE: To see the schema for individual resources:

https://giediprime:9445/qm/service/com.ibm.rqm.integration.service.IIntegrationService/schema/qm.xsd

Page 63: Jazz

63

Dynamic Data Source Configuration

We want to iterate all the test plans.

The REST_qm data source will be configured dynamically.

Add a new Container to the template and place a Data Source Configuration element in it.

Set the data target to REST_qm. The URI will be composed of the base URL for test plan elements and an xpath that extracts all the test plan’s element children from the data source schema.

NOTE: XPath is used to navigate through elements and attributes in an XML document.

Page 64: Jazz

64

Add an external variable The base URL that forms the test

plan URI is stored in an external variable.

To add a new variable, go to the Outline panel, Variables, right-click and select Insert->New variable.

Insert rqmBaseURL as a variable name and select access type external.

NOTE: A user-defined variable can be internal or external. Specify a variable as internal to perform calculations or to temporarily store information. Specify a variable as external when you provide it with a value.

The value of the external variable can be modified from the Document Specification.

Page 65: Jazz

65

Set Query

Create a Table: In the same Container, below the Data source configuration, insert a Table. The first row will be the table header and will have a cell for each of the test plan’s attributes:

name id state owner release modified

Set the feed/entry/content/testplan query to the Container: Drag the desired query from the Data Source Schemas view and drop it on the Container.

Iterate elements: The second row will be used for iterating each test plan element and it has to be positioned inside a Container.

Page 66: Jazz

66

Display test plan attributes

The test plan ID can be found inside the feed/entry/content/testplan/identifier element value, right after the last “:” from the identifier URL. We will use JavaScript expressions to retrieve the identifier information.

To extract the rest of the attributes, set the following queries to the second row’s cells:Name: feed/entry/content/testplan/title State: feed/entry/content/testplan/stateOwner:feed/entry/content/testplan/ownerRelease: feed/entry/content/testplan/ developmentplanModified: feed/entry/content/testplan/updated

• lastIndexOf() returns the position of the last occurrence of the string “:” in the identifier string.

• The variable id stores the substring starting after the occurence of the last “:”.

Page 67: Jazz

67

Test plans - Checkpoint

1. Iterate through all the test plans and display some attributes

2. For each test plan display the related test cases

3. Iterate through all the test cases and display some attributes

4. Create a detailed description of each test case and link the table entry with the description

5. Create a detailed description of each test plan and link the table entry with the description

6. Add title page7. Add Table of Contents8. Configure data sources

Page 68: Jazz

68

Iterate test cases 1/3

We want to generate all test cases linked to a test plan. The test cases will be displayed in a List below the test plan name.

Insert a List element inside the table cell that contains the test plan’s name. Insert two nested Containers inside the list. The first one will contain a Data Source Configuration element and another Container element. The second Container will include the List-detail element and the List-detail will contain a Hyperlink.

Editor area view

Outline view

Nested Container elements

Page 69: Jazz

69

Iterate test cases 2/3 When you want to include information from the test cases, or other child objects of test plans, you need a details feed.

Add a new Data Schema with the name REST_details.

The details schema URL is:https://giediprime:9445/qm/service/com.ibm.rqm.integration.service.IIntegrationService/schema/feed.xsd

Drag the Data Source Schema (REST_details), from the outline, into the Data Source Configuration object.

Drag the test plan reference to the test case (feed/entry/object/testplan/testcase) to the first Container

Drag the test case object from the REST_details data source in the second Container

Hyperlink Display:

testcase/title

Page 70: Jazz

70

Iterate test cases 3/3Configure Data Source Configuration

To see the properties of an object, right click on it in the template outline.

Open the Data Source Configuration properties and set the following properties. Formatting Data target data source: This is the details data source name eg. REST_Details

Formatting Data inherited data configuration: This is the feed data source name eg. REST_qm

Formatting Dynamic configuration URI: This is the location of the links that map from the feed to the details. In this case, feed/entry/content/testplan/testcase/href

This should be entered using the browse option when the value field is selected.

Page 71: Jazz

71

Test plans - Checkpoint

1. Iterate through all the test plans and display some attributes

2. For each test plan display the related test cases

3. Iterate through all the test cases and display some attributes

4. Create a detailed description of each test case and link the table entry with the description

5. Create a detailed description of each test plan and link the table entry with the description

6. Add title page7. Add Table of Contents8. Configure data sources

Page 72: Jazz

72

Reconfigure Data Source REST_QM

We want to iterate all the test cases.

The REST_qm data source will be reconfigured for extracting the test cases.

Add a new Container to the template and place a Data Source Configuration element in it.

Set the data target to REST_qm. The URI will be composed of the base URL for test plan elements and an xpath that extracts all the test plan’s element children from the data source schema.

NOTE: XPath is used to navigate through elements and attributes in an XML document.

Page 73: Jazz

73

Set Query and display attributes

Create a Table: The test cases table will be created similarly to the test plans table. The attributes extracted are:

Id Name State Owner Test phase Weight Modified

Set the feed/entry/content/testcase query to the Container: Drag the desired query from the Data Source Schemas view and drop it on the Container.

Iterate elements: The second row will be used for iterating each test plan element and it has to be positioned inside a container.

Page 74: Jazz

74

Test plans - Checkpoint

1. Iterate through all the test plans and display some attributes

2. For each test plan display the related test cases

3. Iterate through all the test cases and display some attributes

4. Create a detailed description of each test case and link the table entry with the description

5. Create a detailed description of each test plan and link the table entry with the description

6. Add title page7. Add Table of Contents8. Configure data sources

Page 75: Jazz

75

Set Query

Create a Table: Create a table with nine rows and four cells.

Set the feed/entry/content/testcase query to the Container: Drag the desired query from the Data Source Schemas view and drop it on the Container.

NOTE: It’s recommended to add comments to each element, in order to make the template more readable. (Properties -> Metadata -> Name)

Iterate elements: Insert a Container element and drag the Table inside the Container. The table will be iterated for each feed/entry/content/testcase element.

Page 76: Jazz

76

Insert the test case attributes in the table 1/3

The first row contains the title which has a Hyperlink back to the artifact table entry. Use a JavaScript expression to set the Hyperlink content.

Extract the state value from the feed/entry/testcase/state element Extract the description attribute from

feed/entry/testcase/description

The Hyperlink content is the test case identifier multiplied by 0.1, because the identifier range is not unique inside the template and would conflict with other hyperlinks.

Page 77: Jazz

77

Insert the test case attributes in the table 2/3

For the rest of the attributes, extract data

from the following elements:

Type: feed/entry/content/testcase/alias/type

Modified:

feed/entry/content/testcase/updated

Owner: feed/entry/content/testcase/owner

Trigger: feed/entry/content/testcase/trigger

Calculated risk:

feed/entry/content/testcase/risk/riskLevel

Activity:feed/entry/content/testcase/activity

Community risk:

feed/entry/content/testcase/risk/communityAssessment/riskLevel

Weight:feed/entry/content/testcase/weight

Page 78: Jazz

78

Display only non empty attributes 1/3

In order to display just non empty attributes, we will create two conditions for Trigger and Activity attributes.To filter the non empty attributes, select the Text element that displays the attributes, right click and select Data->Edit Condition…

The Script Expression editor will open.

Page 79: Jazz

79

Display only non empty attributes 2/3

There are two ways to create script conditions using this editor:

1) Use embedded operations (right part) to create simple conditions.

2) Drag the operands from the left side and create complex conditions using JavaScript language.

NOTE: Each time it’s recommended to test your condition using the Test Script Expression Dialog, by pressing the Test button.

Page 80: Jazz

80

Table Format

set the cellStyle previously created as style for each cell of the table set Title style on the first row of the table set HeaderCell style on the second, the fourth and the fifth row select a cell, go to Properties panel, Formatting-> Color-> Cell Background color to select a background color for cells select the table, go to Properties panel, Formatting-> positioning-> table alignment-> center.

Table output

Page 81: Jazz

81

Test plans - Checkpoint

1. Iterate through all the test plans and display some attributes

2. For each test plan display the related test cases

3. Iterate through all the test cases and display some attributes

4. Create a detailed description of each test case and link the table entry with the description

5. Create a detailed description of each test plan and link the table entry with the description

6. Add title page7. Add Table of Contents8. Configure data sources

Page 82: Jazz

82

Test plan details

Create a Table: the test plan details structure will have the same format as the one for test cases.

Iterate elements: table will be iterated for each feed/entry/content/testplan element.Make sure the data source is configured for test plans this time.

The Bookmark represents the back-end of the link between the test plan entry in the table and the table details. The

Bookmark and the corresponding Hyperlink must have the same content: feed/entry/content/testplan/identifier.

The title links back to the test plan entry in the main table, by setting the content of the Hyperlink to

feed/entry/content/title.You must place a Bookmark with the same content in the

Test plan table, so that the link will be created.

NOTE: The bookmark should never be placed before a hyperlink, or else an engine error will be generated.

Page 83: Jazz

83

Test plans - Checkpoint

1. Iterate through all the test plans and display some attributes

2. For each test plan display the related test cases

3. Iterate through all the test cases and display some attributes

4. Create a detailed description of each test case and link the table entry with the description

5. Create a detailed description of each test plan and link the table entry with the description

6. Add title page7. Add Table of Contents8. Configure data sources

Page 84: Jazz

84

Add Title Page

1. Insert a Container at the beginning of the template. Set the name to be: “Title Page”2. We want to have the Title Page on a separate page so after the title container we have

to insert a Page Break element.3. Insert three Paragraphs into the Title Page container4. In the first one place the static text “CLM Traceability Report”5. In the second one display the author name

For this we have to create an external variable (author), to set the name of the author at runtime.

6. In the third one, use a script expression to display the current Date.

Variable date stores the current date and time.

Change date format to time, month, day, year.

Page 85: Jazz

85

Format Title Page

1. Title Container set Master Page MP_Content_2

2. First Paragraphset “Title” style set spacing->before spacing : “200”

3. Second paragraphset spacing->before spacing : “50” set alignment->paragraph alignment:

“right”

4. Third paragraphset alignment->paragraph alignment:

“right”

Page 86: Jazz

86

Test plans - Checkpoint

1. Iterate through all the test plans and display some attributes

2. For each test plan display the related test cases

3. Iterate through all the test cases and display some attributes

4. Create a detailed description of each test case and link the table entry with the description

5. Create a detailed description of each test plan and link the table entry with the description

6. Add title page7. Add Table of Contents8. Configure data sources

Page 87: Jazz

87

Add Table of Contents 1/2Add Headers

• Insert a Paragraph element at the beginning of each new section inside the template• Add a static Text to the Paragraph with the name of the template section ( Requirements • table, Requirements details, New Work Items, etc)• Right-click on the Paragraph element, Style->Heading Styles->1.• The content of the Paragraph will appear as a main section title in the Table of Contents.

• Insert a Paragraph element at the beginning of each Requirement description.• Add the dataSource/artifact/title value to the paragraph.• Right-click on the Paragraph element, Style->Heading Styles->2.• The content of the Paragraph will appear as a smaller title in the Table of Contents. • Repeat the procedure for the Work Items, Test Plans and Test Cases descriptions.

Page 88: Jazz

88

Add Table of Contents 2/2

Create ToC

1. Insert a Container as a first template element.2. Create a Paragraph element into this Container3. Insert static text “Table of Contents” into the Paragraph

set Paragraph property font-size: “24”4. Insert Table of Contents element below the Paragraph

Page 89: Jazz

89

Test plans - Checkpoint

1. Iterate through all the test plans and display some attributes

2. For each test plan display the related test cases

3. Iterate through all the test cases and display some attributes

4. Create a detailed description of each test case and link the table entry with the description

5. Create a detailed description of each test plan and link the table entry with the description

6. Add title page7. Add Table of Contents8. Configure data sources

Page 90: Jazz

90

Configure Data Sources

Since the data source is configured dynamically with the parameters specified in the template, you only need to introduce the CLM username and password for the REST_qm data source and to configure the values for the external variables.

In the document specification, select the variable. The properties will be displayed in the Property panel. Insert the value of the variable in the value field.

Page 91: Jazz

91

Configure Output Properties

In the Launcher perspective, expand Output, right-click the Target: Word,

and select Configure Output. Stylesheet: Type or click Browse to specify any Microsoft Word 1997-2003 document or template (.doc or .dot) or Microsoft 2007 (.docx or .dotx).

Macro: Enter the Word macros to use in the generated output.

NOTE: The macro is run only if Microsoft Word is available on the computer that hosts RPE. The macro must be defined in the style sheet.

Page 92: Jazz

92

Save Document Specification

After configuring the document specification, go to RPE Launcher and select the Save button. When creating a new template, you can open saved document specifications (File-> Open Document Specification).

After saving the document specification, select the Run button to generate the document.

Run button

Save button

Displays the list of errors and warnings

in the template.

Page 93: Jazz

93

Results 1/5

Title Page Table of Contents

Page 94: Jazz

94

Results 2/5

Content Pages

Page 95: Jazz

95

Results 3/5

Content Pages

Page 96: Jazz

96

Results 4/5

Content Pages

Page 97: Jazz

97

Results 5/5

Content Pages

Page 98: Jazz

98

More Information

RPE Online Help http://publib.boulder.ibm.com/infocenter/rsdp/v1r0m0/index.jsp?topic=/com.ibm .help.download.tpe.doc/topics/publishingengine_version1_1.html

RPE Developer Works Forum http://www.ibm.com/developerworks/forums/forum.jspa?forumID=1512

RPE Community Wiki

http://www.ibm.com/developerworks/wikis/display/rpe/Home

Page 99: Jazz

99

Media Channels

Reporting Arena on YouTube

Reporting Arena on Twitter

Reporting Arena on Facebook

Reporting Arena on LinkedIn