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
-
From the menu, select Data > Add Data Source Schema
-
The Data Source Schema Discovery Wizard is launched
-
Click Next
-
In the Schema Type field, select REST
-
Click Browse to select a Schema file
-
Browse to RhapsodyInstallDirectory/Share/RPE/Schemas
-
Select Default.xsd
-
Click Open
-
In the Name field, type SysML
-
Click Next
3. Summary
Click Finish
4. Observe Schema
-
In the lower left hand corner is the Schema panel.
-
The schema panel shows what you could extract from a model
-
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.
-
Select the Paragraph tool from the Palette in the upper left hand corner.
-
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
-
Right-click the Paragraph you just added and select Insert > Text
-
A Text Container is added inside the Paragraph Figure 8-Text Container
-
Double-click the Text Container
-
Select the Simple Value Tab
-
Enter the text: Simple Report
-
Click OK
7. Apply a Style
-
Right-click the Paragraph Container and select Styles > Heading Styles > 1
-
An icon indicates you have applied a style
8. Generate a Report
-
From the menu select Document Specification > Generate Current Document
-
Click Yes to Save the changes in the template
-
Name the Template SimpleReport.dta
-
Click Save
-
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
-
In the Document Specification panel, select the Data Source: SysML - REST
-
In the Properties panel below it - note there is a property URI
-
Click inside the URI field and enter the Rhapsody REST Server address(For example http://localhost:27464/Rational/Rhapsody)
-
From the menu select Document Specification > Generate Current Document
-
A results window is displayed - check your document by clicking one of the hyperlinks.
-
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
-
From the Palette, select the Container tool
-
Click inside the Template area - underneath the Paragraph Container (not inside it)
Figure 5: New
Container
12. Set the context for the Container
-
In the Data Source Schemas panel - expand the tree to: Projects > Project > PredefinedQueries >
AllUseCaseDiagrams > UseCaseDiagram
-
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
-
From the Palette, select the Paragraph tool
-
Click once inside the Use Case Diagram Container
-
Right-click the Paragraph Container and select Insert > Text
-
Double-click the Text Container
-
Select the Data Expression tab f.Expand the Attributes entry
-
Expand the $1 Node Tip: Note that $1 corresponds to the Use Case Diagram Container in
your template
-
Select name
-
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
-
From the menu select Document Specification > Generate Current Document
-
Click Yes to save your changes. Tip: Note that since you already
configured the Data Source - you do not have to do it again.
-
Confirm your document now contains the name of the only Use Case Diagram in the model.
16. Add a Container to extract Use Cases
-
From the Palette, select the Container tool
-
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
-
In the Data Source Schema panel, expand the UseCaseDiagram node and select Contained Elements > Model Element
-
Drag the ModelElement node onto the Container you added in step 16
-
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.
-
Select the ModelElement Container
-
In the properties window (to the bottom right) locate and expand the Data entry
-
Click inside the Filter box - when the button with three dots appears - click it
-
Select the Scripted Filter tab
-
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.
-
For the Operator, select Equals
-
In the Right operand field, type UseCase
-
Click Add
-
Click OK to close the Filter Editor
19. Report on Use Cases
-
From the Palette, select the Paragraph tool
-
Click inside the ModelElement Container to add a new one
-
Right-click the Paragraph Container you just added and select Insert > Text
-
Double click the Text Container
-
Select the Data Expression tab
-
Expand Attributes > Model Element Node (again pay attention to the $ number - this will tell
you which node is which)
-
Select name
-
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
-
From the Palette, select the Container tool
-
Click inside the Use Case Diagram Container - after the Use Case Diagram name paragraph but before the Container
that iterates over ContainedElements
-
In the Data Source Schemas panel - expand the tree to: Projects > Project > PredefinedQueries >
AllUseCaseDiagrams > UseCaseDiagram > Pictures > Picture
-
Drag the Picture node onto the Container you just created
-
Click OK to select the context
-
From the Palette, select the Image tool
-
Click once inside the Picture Container
-
Double-click the Image Container
-
Select the Data Expression Tab
-
Expand Attributes
-
Expand the node that corresponds to your Picture Container l.Select path
-
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.
|