< Previous | Next >

Extend a role

The goal of this exercise is to extend base method content associated with a role by using Extends variability.

Extends variability works differently than contributes variability in that the method content element that extends the base method element inherits the attributes of the extended base element.
  1. Switch back to the Authoring perspective.
  2. Create a new content package under my_plug-in. Name the new content package "extends_test". Close the editor panel and save your changes.
  3. Create a new role under the extends_test content package.
  4. Use these attributes for the new role:
    • Name: my_extends_developer
    • Presentation name: Extends OpenUP Developer
    • Brief Description: My extended role brief description
    • Main Description: My extended role description
  5. Use the Variability type menu to select Extends then click Select . The Select Dialog: Roles window opens.
  6. Select the developer role and click OK. This will be the base role that our customization extends.
  7. Save the new role by closing the editor panel.
  8. Update the configuration to include the new content package by doing the following:
    1. Double-click the my.basic.configuration icon in the Library view panel. The configuration editor panel opens.
    2. Click the Plug-in and Package Selection tab.
    3. Expand my_plug-in > Method Content > Content Packages.
    4. If they are checked, clear contribution_test and my_content_package. We do this to make sure that no contributions are coming from other content packages.
    5. Make sure that extends_test is checked.
    6. Close and save the changes to the configuration.
  9. Switch to the Browsing perspective. Make sure that you are using my.basic.configuration.
  10. In the Configuration view, select Extends OpenUp Developer in the Uncategorized Roles folder under the Role Sets folder. You will see in the HTML page that content entered in the extending role has been replaced, whereas content not provided has been inherited from the base artifact. Note that the extended role Developer remains unchanged.
    the Developer role now shows the extended text in the main description field
< Previous | Next >