Filter Elements in Report Template Development

When generate report with a report template, all the model/ diagram elements in the project that match the template definition will be generated to the report. But in some case, you might want to filter out some elements in the generated report. In this tutorial, you will learn how to define report template and filter out elements by element name, by stereotype and by project management properties.

August 16, 2010
User Rating: / 0
Views: 2,059
PDF Link Add comments
Edition: Standard or above (Edition comparison)

Filtering by element name

  1. Download ATM.vpp from this tutorial
  2. Open the use case diagram of the project with VP-UML.
    usecase diagram
  3. Let's generate a PDF report with use case diagram. Select Doc > Generate PDF Report... from the toolbar.
    generate report
  4. In the Generate PDF dialog box, select <New> from the drop-down menu of Template.
    new template
  5. Create a template and name it as Filter by name.
    template name
  6. Click Add Diagram Loop button.
    add diagram loop
  7. Select Use Case Diagram from the list on the right-hand side of the dialog box.
    select usecase diagram
  8. From the diagram loop, click Add Element Loop button.
    add element loop
  9. Select Use Case from the list on the right-hand side of the dialog box.
    select usecase
  10. From the element loop, click Add Property Value button. Select Use Case ID from the list of properties.
    add property value
    Similarly, click Add Property Value button from the element loop and then select Documentation from the list of properties.
    add documentation
  11. Click Element Loop (Use Case). Click on the green right button of Use Case. Uncheck balance, Donate money to charity, Pay bills, Login, Handle invalid password and Handle abort to ignore them during report generation.
    deselect usecases
  12. After finished editing, save the template by clicking Save button on the toolbar.
    save template
  13. Click Close at the bottom right corner of the dialog box.
  14. In the Generate PDF dialog box, specify an output path and click Generate at the bottom of dialog to generate a report.
    generate report
  15. The following image shows the generated report. Only Withdraw cash use case and Transfer money use case re generated.
    generate report

Filtering by stereotype

  1. Let's specify process stereotype to use case. Right click on the Check balance use case and select Stereotypes > process from the pop-up menu.
    set process After that, specify Process stereotype for Pay bills use case. The resulting use case diagram is as follow:
    usecases process
  2. After defining diagram and elements in report template, you can filter those use cases you don't want them to be generated by their stereotype. Click Element Loop (Use Case) and then uncheck all stereotypes, except process.
    deselect stereotype
  3. The following image shows the generated report. Only Check balance use case and Pay bills use case with Process are generated.
    generated report

Filtering by project management properties

  1. Let's assign priority to Withdraw cash use cases. Right click on Withdraw cash use case and select Open Specification... from the pop-up menu.
    open spec
  2. In the Use Case Specification dialog box, open Project Management tab. Select High from the combo box of Priority.
    high priority
  3. Repeat the steps to assign priority for other use cases in the diagram:
    Use Case Priority
    Check balance Medium
    Donate money to charity Low
    Transfer money Medium
    Pay bills Medium
    Login High
    Handle invalid password Low
    Handle abort Low
  4. After defining diagram and elements, you can keep filter the use cases you want to generated in report by their priority. Let's generate report only for use cases with high priority. Click Element Loop (Use Case). Click the Add button under Project Management Filter section.
    add filter
  5. Select Priority from the pop-up menu.
    add priority
  6. Select High from the combo box of Priority.
    select high
  7. The following image shows the generated report. Only Withdraw cash use case and Login use case with high priority are generated.
    generated report

Resources

  1. ATM.vpp

Rate this Article

Click on one of the stars below to rate this article from 1 (lowest) to 5 (highest).

You may be interested in

  1. Writing Effective Use Case
  2. UML Package Diagram
    Tagged:
  3. Draw Entity Relationship Diagram (ERD)
    Tagged:
  4. Produce UML Use Cases from Business Process Diagram (BPD)
  5. Draw UML Sequence Diagram with Keyboard
Tags of this article:

Comments (0)

Write comment

Rating

Comment

Enter the calculation result

security code