This lesson shows how to create a joint data set and how
to add it to the report design file.
The joint data set that you create lists the use cases in
which each actor participates.
To create a joint data set and add
it to the report design:
- To continue designing, click the Layout tab
in the report design editor.
- Create a data set for business actors:
- In the Data Explorer view, right-click Data
Sets; then click New Data Set.
- Name the data set Business Actors,
click Next, and click Next again.
- On the Row Mapping page, in the Expression field,
press Ctrl+Space, and then double-click getElementsWithStereotype.
- In the expression, replace inputXPath with //*,
and replace inputStereotypes with Business
Modeling::BusinessActor. When you run the report, this
expression finds all the elements in the model that are stereotyped
as a business actor.
- Set the value for Type to uml:Actor and
the value for Stereotypes to BusinessModeling::BusinessActor.
To do this, under Browse, click the down arrow
and click Sample Business Model.emx.
- Select <BusinessActor> Sample Use Case,
click the right-arrow (>) button for Type and
click the right-arrow button for Stereotypes.
- Click Next.
- On the Column Mapping page, under Browse,
click the down arrow and click uml:Actor.
- In the structure hierarchy, click name,
and then click the right-arrow button.
- In the Column Query table, click Add new
column, and for the new column assign the following values:
- For Name, type uri.
- For Query, type getURI(.).
- For Type, select String.
Note: The custom function getURI() is a good
key to use for data set joins because the URI of a model element is
unique.
- Click Finish and click OK.
The Edit Data Set window closes.
- Create a data set for business use-case associations:
- Create a new data set named Business Use
Case Associations.
- On the Row Mapping page, browse the UML metamodel for Association,
and specify //Association as the expression
and uml:Association as the type.
You
can enter the values for expression and type by clicking the right-arrow
button for the fields. You must edit the entry for the expression
by manually adding the slashes (//).
This
report focuses on the associations between actors and use cases.
Each association requires the URI of the actor at one end and the
name of the use case at the other end. You use the URI of the actor
to join this data set with the Business Actors data set that you created
in the previous step.
- Click Next.
- In the Column Query table, create a new column with
the following values:
- For Name, type actorURI.
- For Query, type getURI(oclQuery(endType,
"self.oclIsKindOf(uml::Actor)")).
- For Type, select String.
- In the Column Query table, create a new column with
the following values:
- For Name, type usecaseName.
- For Query, type oclQuery(endType,
"self.oclIsKindOf(uml::UseCase)")/@name.
- For Type, select String.
- Click Finish and click OK.
- Create a joint data set for actor associations:
- In the Data Explorer view, right-click Data
Sets; then click New Joint Data Set.
- Name the data set Business Actor Associations.
- For the entry on the left, select Business
Actors and click uri.
- For the entry on the right, select Business
Use Case Associations and click actorURI.
- Click Left Outer Join. This includes
actors in the report even if they are not associated with use cases.
- Click Finish and click OK.
- Add to the report a table for business actors and the use
cases in which they participate:
- Add a label to the report design with Business
Actors as the label text, and apply the style that you
use for labels at this level in the report.
- Add a table to the report design with 2 columns and Business
Actor Associations as the data set.
- Apply the table style, which includes a 12 point margin
above and below, to the table.
- Insert labels for the column headers, type Actor
Name for the first column header and Use Case
Participation for the second, and apply the style that
you created for column headers.
- Right-click Detail Row; then
click Insert Group.
- In the Name field, type actorGroup.
- In the Group On field, select Business
Actors::uri.
- Click OK. This adds a Group Header
Row to the table.
- Define a style, and apply it to the Group Header Row
for both columns.
- In the Group Header Row, right-click [Business
Actos::uri]; then click Delete.
- In the Data Explorer view, expand Data Sets and
expand Business Actor Associations.
- Drag Business Actors::name into
the Group Header Row of the column on the left.
- In the Palette, click Table and
drag the cursor into the Detail Row of the column on the right.
- Set the number of columns to 1 and click OK.
- In the Data Explorer view, under Business Actor Associations,
drag Business Use Case Associations::usecaseName into
the Detail Row of the nested table.
- Delete the contents of the Header Row in the nested
table.
- Save the report design file.
- Preview the report. The actor and the use case it participates
in from the Sample Business Model.emx instance model are displayed.
If you are working in English, the preview should now look similar
to the following figure:
You have now completed the report design. In the next lesson,
you use it to generate a report for the target catering model.