Guideline: Creating Report Templates using the RPE Document Studio
This guideline describes how to create reports using the IBM Rational Publishing Engine Document Studio.
Relationships
Main Description
1. Launch the Document Studio

From the Windows Start Menu, select All Programs > IBM Rational > IBM Rational Publishing Engine Document Studio

                                                                Figure 1: Rational Publishing Engine Document Studio

2. Add a Data Source Schema
  1. From the menu, select Data > Add Data Source Schema
  2. The Data Source Schema Discovery Wizard is launched
  3. Click Next
  4. In the Schema Type field, select REST
  5. Click Browse to select a Schema file
  6. Browse to RhapsodyInstallDirectory/Share/RPE/Schemas
  7. Select Default.xsd
  8. Click Open
  9. In the Name field, type SysML
  10. Click Next
3. Summary

Click Finish

4. Observe Schema
  1. In the lower left hand corner is the Schema panel.
  2. The schema panel shows what you could extract from a model
  3. You will drag elements from the schema panel into the template

          Figure 2: Schema Panel

5. Add a Paragraph

Lets start by adding some simple text to the report.

  1. Select the Paragraph tool from the Palette in the upper left hand corner.
  2. Click once inside the Template area in the center to add a Paragraph Container

     Figure 3: The Template Panel - with a Paragraph added

6. Add Text
  1. Right-click the Paragraph you just added and select Insert > Text
  2. A Text Container is added inside the Paragraph Figure 8-Text Container
  3. Double-click the Text Container
  4. Select the Simple Value Tab
  5. Enter the text: Simple Report
  6. Click OK
7. Apply a Style
  1. Right-click the Paragraph Container and select Styles > Heading Styles > 1
  2. An icon indicates you have applied a style
8. Generate a Report
  1. From the menu select Document Specification > Generate Current Document
  2. Click Yes to Save the changes in the template
  3. Name the Template SimpleReport.dta
  4. Click Save
  5. Click Change Perspective

Tip: Since this is the first time you have tried to generate the document - Rational Publishing Engine Document Studio does now know where your actual Data Source is. You will be presented with a dialog indicating this. Rational Publishing Engine Document Studio has two Perspectives - RPE Launcher and RPE Studio. RPE Studio is used to construct the Template. RPE Launcher is used to configure the document generation. You may switch between them at any time by clicking the appropriate button in the top left hand corner.

9. Configure the Data Source

For this step you will need the address of the Rhapsody REST Server. The easiest way to get this is to start the Report Generation Wizard in Rhapsody - this will also start the REST server - and then cancel the Report Generation Wizard. The REST server has a console window which shows the address - you can copy the address from this console window:

                                            Figure 4: Rhapsody REST Server Console

  1. In the Document Specification panel, select the Data Source: SysML - REST
  2. In the Properties panel below it - note there is a property URI
  3. Click inside the URI field and enter the Rhapsody REST Server address(For example http://localhost:27464/Rational/Rhapsody)
  4. From the menu select Document Specification > Generate Current Document
  5. A results window is displayed - check your document by clicking one of the hyperlinks.
  6. Click Close to close the results window
10. Return to the Document Studio

Click on the RPE Studio button to return to the Document Studio Perspective:

11. Add a Container
  1. From the Palette, select the Container tool
  2. Click inside the Template area - underneath the Paragraph Container (not inside it)

                 Figure 5: New Container

12. Set the context for the Container
  1. In the Data Source Schemas panel - expand the tree to: Projects > Project > PredefinedQueries > AllUseCaseDiagrams > UseCaseDiagram
  2. Select the UseCaseDiagram node and drag it to the Container you added in step 11

Tip: This Container will now iterate over all Use Case Diagrams. Any Containers inside this one will be processed once for each Use Case Diagram. In effect this Container says 'For Each Use Case Diagram .....'

13. Add the Use Case Diagram Name
  1. From the Palette, select the Paragraph tool
  2. Click once inside the Use Case Diagram Container
  3. Right-click the Paragraph Container and select Insert > Text
  4. Double-click the Text Container
  5. Select the Data Expression tab f.Expand the Attributes entry
  6. Expand the $1 Node Tip: Note that $1 corresponds to the Use Case Diagram Container in your template
  7. Select name
  8. Click OK

                                                  Figure 6: Selecting a Data Expression

14. Apply a style

Right-click the Paragraph Container inside the Use Case Diagram Container and select Style > Heading Styles > 2

15. Generate the document
  1. From the menu select Document Specification > Generate Current Document
  2. Click Yes to save your changes. Tip: Note that since you already configured the Data Source - you do not have to do it again.
  3. Confirm your document now contains the name of the only Use Case Diagram in the model.
16. Add a Container to extract Use Cases
  1. From the Palette, select the Container tool
  2. Click inside the Use Case Diagram Container - right at the bottom Tip: You want the next part to occur after the Paragraph that prints out the diagram name.
17. Set the context for the Container
  1. In the Data Source Schema panel, expand the UseCaseDiagram node and select Contained Elements > Model Element
  2. Drag the ModelElement node onto the Container you added in step 16
  3. Click OK to set the context for this Container to be inside the previous one.
18. Apply a Filter

You dont want to report on every element that appears on the Use Case Diagram - only the Use Cases. You will apply a filter to the Container such that only Use Cases are reported.

  1. Select the ModelElement Container
  2. In the properties window (to the bottom right) locate and expand the Data entry
  3. Click inside the Filter box - when the button with three dots appears - click it
  4. Select the Scripted Filter tab
  5. On the right-hand side of the window - for the Left operand, select metaclass (of the ModelElement Container) Tip: Make sure it is the metaclass of the correct container. The $ number will tell you which container is which.
  6. For the Operator, select Equals
  7. In the Right operand field, type UseCase
  8. Click Add
  9. Click OK to close the Filter Editor
19. Report on Use Cases
  1. From the Palette, select the Paragraph tool
  2. Click inside the ModelElement Container to add a new one
  3. Right-click the Paragraph Container you just added and select Insert > Text
  4. Double click the Text Container
  5. Select the Data Expression tab
  6. Expand Attributes > Model Element Node (again pay attention to the $ number - this will tell you which node is which)
  7. Select name
  8. Click OK
20. Generate the document

Generate the document as you have done in previous steps and confirm that the report now contains the names of the Use Cases

21. Add the Use Case Diagram
  1. From the Palette, select the Container tool
  2. Click inside the Use Case Diagram Container - after the Use Case Diagram name paragraph but before the Container that iterates over ContainedElements
  3. In the Data Source Schemas panel - expand the tree to: Projects > Project > PredefinedQueries > AllUseCaseDiagrams > UseCaseDiagram > Pictures > Picture
  4. Drag the Picture node onto the Container you just created
  5. Click OK to select the context
  6. From the Palette, select the Image tool
  7. Click once inside the Picture Container
  8. Double-click the Image Container
  9. Select the Data Expression Tab
  10. Expand Attributes
  11. Expand the node that corresponds to your Picture Container l.Select path
  12. Click OK

                                                         Figure 7: Selecting Path

22. Generate the report

Generate the report as you have done in previous steps - verify that the Use Case Diagram now appears in the report as a graphic.