< Previous | Next >

Lesson 5: Add grouped data to the report design

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:

  1. To continue designing, click the Layout tab in the report design editor.
  2. Create a data set for business actors:
    1. In the Data Explorer view, right-click Data Sets; then click New Data Set.
    2. Name the data set Business Actors, click Next, and click Next again.
    3. On the Row Mapping page, in the Expression field, press Ctrl+Space, and then double-click getElementsWithStereotype.
    4. 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.
    5. 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.
    6. Select <BusinessActor> Sample Use Case, click the right-arrow (>) button for Type and click the right-arrow button for Stereotypes.
    7. Click Next.
    8. On the Column Mapping page, under Browse, click the down arrow and click uml:Actor.
    9. In the structure hierarchy, click name, and then click the right-arrow button.
    10. 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.
    11. Click Finish and click OK. The Edit Data Set window closes.
  3. Create a data set for business use-case associations:
    1. Create a new data set named Business Use Case Associations.
    2. 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.

    3. Click Next.
    4. 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.
    5. 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.
    6. Click Finish and click OK.
  4. Create a joint data set for actor associations:
    1. In the Data Explorer view, right-click Data Sets; then click New Joint Data Set.
    2. Name the data set Business Actor Associations.
    3. For the entry on the left, select Business Actors and click uri.
    4. For the entry on the right, select Business Use Case Associations and click actorURI.
    5. Click Left Outer Join. This includes actors in the report even if they are not associated with use cases.
    6. Click Finish and click OK.
  5. Add to the report a table for business actors and the use cases in which they participate:
    1. 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.
    2. Add a table to the report design with 2 columns and Business Actor Associations as the data set.
    3. Apply the table style, which includes a 12 point margin above and below, to the table.
    4. 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.
    5. Right-click Detail Row; then click Insert Group.
    6. In the Name field, type actorGroup.
    7. In the Group On field, select Business Actors::uri.
    8. Click OK. This adds a Group Header Row to the table.
    9. Define a style, and apply it to the Group Header Row for both columns.
    10. In the Group Header Row, right-click [Business Actos::uri]; then click Delete.
    11. In the Data Explorer view, expand Data Sets and expand Business Actor Associations.
    12. Drag Business Actors::name into the Group Header Row of the column on the left.
    13. In the Palette, click Table and drag the cursor into the Detail Row of the column on the right.
    14. Set the number of columns to 1 and click OK.
    15. In the Data Explorer view, under Business Actor Associations, drag Business Use Case Associations::usecaseName into the Detail Row of the nested table.
    16. Delete the contents of the Header Row in the nested table.
    17. Save the report design file.
    18. 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.
< Previous | Next >

Feedback